All insights

Inference economics

How to Represent Retries and Fallbacks Without Hiding Duplicate Execution

Retries and fallbacks should appear as uniquely identified execution attempts beneath one stable logical operation. Each attempt should record its authorization, trigger, timing, target, outcome, side effects, and relationship to the accepted result. Executions without consistent operation identity or policy lineage should be investigated as possible duplicates—not automatically classified as duplicates.

Retries and fallbacks should appear as uniquely identified execution attempts beneath one stable logical operation. Each attempt should record its authorization, trigger, timing, target, outcome, side effects, and relationship to the accepted result. Executions without consistent operation identity or policy lineage should be investigated as possible duplicates—not automatically classified as duplicates.

The short answer: group authorized attempts under one logical operation

An audit model should distinguish logical intent from physical execution. The logical operation represents what the caller asked the system to accomplish. Attempt records represent every physical action taken to accomplish it, including the initial request, sequential retries, concurrent hedges, and fallback routing.

This parent-child model gives an auditor a coherent answer to five questions:

  1. What was intended? The logical operation and its requested outcome.
  2. What executed? Every physical attempt, including concurrent attempts.
  3. Why did it execute? The trigger and policy that authorized it.
  4. Did it cause side effects? The known, absent, or uncertain effects of each attempt.
  5. Which result was accepted? The attempt whose response became the operation’s result.

The categories should remain distinct:

Execution typeRecommended representationPrimary audit evidence
Initial attemptFirst child of the logical operationAttempt sequence 1 and type initial
RetryNew attempt authorized after a prior attempt encountered a defined conditionRetry trigger, policy version, and relationship to the prior attempt
HedgeConcurrent, policy-authorized attempt intended to reduce tail latencyHedge authorization, concurrency timing, winner, and cancellation state
FallbackAttempt directed to a different target or routeOriginal target, selected fallback, routing reason, and decision time
Suspected duplicateExecution with missing, conflicting, or unauthorized lineageCorrelation conflicts, absent policy authorization, and side-effect evidence requiring investigation

A retry should not overwrite the original attempt’s record. A fallback should not be represented merely as a change to a generic target field. A hedge should not look like an ordinary sequential retry. Preserving each execution separately allows an auditor to reconstruct what actually happened instead of seeing only the final successful response.

What distinguishes intended resilience from a suspected duplicate

An intended resilience action has a documented chain of authority and causality. For example, an attempt record might show that retry policy interactive-timeout-v4 authorized attempt 2 after attempt 1 exceeded a response deadline. The second attempt remains part of the same logical operation but receives its own attempt identity, timestamps, target, and outcome.

A repeated execution becomes suspicious when that chain is absent or inconsistent. Investigation signals include:

  • Two executions that appear to perform the same work but have different logical-operation identifiers.
  • Multiple attempts under one operation with no recorded retry, hedge, or fallback authorization.
  • An attempt sequence that conflicts with event ordering.
  • A new target with no routing decision or fallback reason.
  • Reuse of an idempotency key with conflicting payloads.
  • Multiple results marked as accepted for an operation that should have one accepted result.
  • Evidence of repeated side effects without a corresponding deduplication decision.

None of these signals proves duplication by itself. Missing telemetry can result from propagation errors, partial outages, asynchronous processing, or instrumentation gaps. The appropriate representation is therefore suspected_duplicate or lineage_unresolved until other evidence establishes what occurred.

Why a shared trace ID is not sufficient evidence

A trace or correlation ID helps collect related activity, but it does not establish that every execution was authorized. A defective client can send the same request twice under one trace. Two independent operations can also receive the same identifier through propagation or implementation errors.

Auditors need additional evidence around each attempt:

  • A unique attempt identifier.
  • The attempt’s type and sequence.
  • The policy and policy version that authorized it.
  • The condition that triggered it.
  • Causal or temporal ordering.
  • Original and selected targets.
  • Cancellation and completion status.
  • Idempotency and deduplication decisions.
  • Side-effect state.
  • The result accepted by the caller or orchestrator.

A trace ID answers, “Which activity may be related?” Attempt-level lineage answers, “Why was this particular execution allowed, and what did it do?”

Use separate identities for the operation, every attempt, and the accepted result

A practical design uses a parent logical-operation record with child attempt records. It also identifies the result ultimately accepted by the caller. The following field names are illustrative rather than requirements of a particular telemetry standard or product.

Stable operation and correlation identifiers

The operation_id should remain stable from initial receipt through completion. It identifies one unit of business or system intent, even if several physical executions are required. Where calls cross services, queues, gateways, or inference endpoints, separate correlation identifiers can connect related technical activity without replacing the operation identity.

The parent operation record can capture:

  • Requested action and a non-sensitive payload fingerprint where appropriate.
  • Caller, actor, or originating service identity.
  • Creation and completion timestamps.
  • Overall operation status.
  • Policy context at the time of execution.
  • The accepted attempt and accepted result.
  • Whether unresolved attempts could still complete.

Avoid deriving logical identity solely from a timestamp, trace ID, or payload hash. These can support correlation, but they may collide, change across boundaries, or group requests that are similar without representing the same intent.

Unique attempt IDs, sequence numbers, and attempt types

Every physical execution should receive an attempt_id, including executions that fail before reaching the intended target. The attempt should also have a sequence number and an explicit type such as initial, retry, hedge, or fallback.

A recommended record can include the following fields:

FieldAudit purpose
operation_idConnects all attempts to one logical intent
attempt_idUniquely identifies one physical execution
attempt_sequenceShows expected ordering within the operation
attempt_typeDistinguishes initial, retry, hedge, and fallback behavior
policy_id / policy_versionIdentifies the rule that authorized the attempt
trigger_classRecords timeout, transport error, status class, capacity condition, or policy decision
original_target / selected_targetPreserves route and fallback lineage
decision_timestampShows when another attempt or route was selected
start_time / end_timeEstablishes execution timing and overlap
outcomeRecords success, error, timeout, rejected, or unknown
cancellation_stateShows whether cancellation was requested, confirmed, failed, or unknown
completion_uncertainPreserves the possibility that an earlier attempt completed
actor_identityIdentifies the service or component initiating the execution
accepted_resultIndicates whether this attempt supplied the result used by the operation

The trigger should be structured rather than buried only in a human-readable message. Useful trigger classes can include deadline_exceeded, transport_error, response_status, capacity_unavailable, and routing_policy. An accompanying detail field can preserve diagnostic context without making downstream analysis depend on free-form text.

Policy version matters because retry and routing behavior changes over time. Recording only a policy name can leave an auditor unable to determine which thresholds, eligible targets, or limits were active during the event.

Where feasible, preserve append-only event sequence data, trusted timestamps, or another reconstructable causal order. Clock time alone may be insufficient when systems have clock skew or events arrive asynchronously.

Idempotency keys, side-effect boundaries, and repeat-safety status

Retry authorization does not establish that an operation is safe to repeat. The audit record should separately describe repeat safety and side effects.

Relevant fields can include:

  • idempotency_key: the key used to associate repeated submissions where applicable.
  • repeat_safety: a classification such as safe, conditionally_safe, unsafe, or unknown.
  • deduplication_decision: whether execution proceeded, was suppressed, reused a prior result, or could not be determined.
  • side_effect_boundary: the component or step at which durable effects can begin.
  • side_effect_state: none, committed, compensated, partial, or unknown.

A timeout must not automatically be recorded as “no execution.” The upstream service may have completed after the caller stopped waiting. Likewise, a cancellation request does not prove cancellation succeeded. Record the distinction between cancellation_requested and cancellation_confirmed, and preserve uncertainty when confirmation is unavailable.

For read-only inference requests, side effects may still exist outside the model response, such as usage accounting, tool calls, message publication, cache writes, or downstream workflow transitions. The side-effect boundary should therefore reflect the complete operation, not merely the model invocation.

Represent concurrent and hedged attempts explicitly

A hedge starts another attempt while an earlier attempt remains active. It should be represented as concurrent and policy-authorized, not as a retry after failure.

The record should show:

  • Which attempt the hedge was launched against.
  • The hedge delay or condition that authorized it.
  • The overlap between attempts.
  • Which attempt produced the accepted result.
  • Whether cancellation was requested for the losing attempt.
  • Whether the losing attempt’s completion or side effects remain uncertain.

Without these details, two overlapping executions can appear indistinguishable from accidental duplicate requests. Conversely, simply labeling an execution hedge should not make it legitimate; the label should be corroborated by policy, timing, and decision records.

Illustrative audit records

The following compact examples show how the same data model can represent different outcomes.

Successful retry

operation_id: op-8421
accepted_attempt_id: att-8421-2

attempt 1:
  attempt_id: att-8421-1
  type: initial
  target: endpoint-a
  outcome: timeout
  completion_uncertain: true
  side_effect_state: unknown

attempt 2:
  attempt_id: att-8421-2
  type: retry
  authorized_by: timeout-policy / version 4
  trigger: deadline_exceeded on att-8421-1
  target: endpoint-a
  outcome: success
  accepted_result: true

This record supports the conclusion that the second execution was an intended retry. It does not assume the first attempt stopped merely because the caller observed a timeout.

Policy-authorized fallback

operation_id: op-9130
accepted_attempt_id: att-9130-2

attempt 1:
  attempt_id: att-9130-1
  type: initial
  original_target: model-route-primary
  outcome: capacity_unavailable

routing decision:
  policy: capacity-fallback / version 7
  reason: primary target unavailable
  selected_target: model-route-secondary
  decision_time: 2026-09-08T10:15:22Z

attempt 2:
  attempt_id: att-9130-2
  type: fallback
  target: model-route-secondary
  outcome: success
  accepted_result: true

The routing decision creates lineage between the original target and the fallback. Recording only the final target would conceal why two targets were involved.

Suspected duplicate requiring investigation

execution A:
  operation_id: op-1201
  attempt_id: att-1201-1
  idempotency_key: key-77
  side_effect_state: committed

execution B:
  operation_id: op-1202
  attempt_id: att-1202-1
  idempotency_key: key-77
  policy_authorization: absent
  payload_fingerprint: matches execution A
  side_effect_state: unknown

classification: suspected_duplicate
reason: same idempotency key and matching work under distinct operation IDs

This pattern warrants investigation, but the record should not declare a proven duplicate based only on conflicting identifiers. An auditor may need gateway logs, application events, queue delivery data, or side-effect records to determine whether the executions represented one intent or two.

Test the record against an auditor’s reconstruction task

Before relying on the design, test whether a reviewer can reconstruct a difficult event without interpreting informal log messages. The record should make it possible to answer:

  • What request or workflow outcome did the caller intend?
  • How many physical executions occurred?
  • Were any attempts concurrent?
  • What rule authorized each additional execution?
  • What condition triggered the retry, hedge, or fallback?
  • Which service made the routing decision, and under which policy version?
  • Could a timed-out or cancelled attempt still have completed?
  • Where could durable side effects occur, and what evidence describes them?
  • Was deduplication evaluated, and what decision was made?
  • Which result was accepted, and were any other results discarded or unresolved?

If these questions cannot be answered, adding more log volume will not necessarily solve the problem. The missing element is often structured lineage between intent, authorization, execution, effects, and result selection.

Applying this model to enterprise LLM inference

These design questions are particularly relevant when an inference serving layer performs model or endpoint selection for latency-sensitive chat, batch enrichment, or agentic workflows. Routing decisions may cross private infrastructure and managed endpoints, while timeouts can leave the completion state of an upstream request uncertain.

Token Forge Cloud Private LLM Inference focuses on private deployment and serving-layer optimization for enterprise AI workloads, including routing, caching, batching, quantization, and GPU scheduling. Token Forge Cloud Managed Model APIs provide an API-first path for teams evaluating model access before workloads move toward a private deployment strategy.

When evaluating either approach, consider how the complete architecture—not only the model endpoint—represents logical operations, physical attempts, route changes, policy versions, idempotency, side effects, and accepted results. We provide the schema above as an architectural evaluation model, not as documentation of specific Token Forge Cloud retry, deduplication, tracing, or audit-export functionality.

Contact Token Forge Cloud to discuss API access, private deployment, and LLM inference cost control.

Contact us