Viyan

Viyan AI

LLMs Fail at Procedural Rule-Following

The TAM benchmark shows that models currently struggle to follow long-horizon, interdependent rules, failing even when equipped with retrieval-augmented generation.

The Tasks over Application Manuals (TAM) benchmark demonstrates that general-purpose language models struggle to execute long-horizon, rule-based procedures. While many benchmarks test a model's ability to answer from a single prompt, TAM forces models to navigate hundreds of pages of interdependent guidelines. When tested on procedural tasks from ICD-10-CM clinical coding and U.S. federal sentencing, GPT-5 using evaluated approaches including RAG, ReAct, and agent-harness baselines achieved exact-match scores of 1% and 15.5% respectively.

Sequential Failure in Structured Tasks

The TAM benchmark requires the model to produce an exact answer only after traversing a specific sequence of interdependent sections in an authoritative document. A failure to identify a single cross-referenced constraint early in the process invalidates the final output. Consider a coder applying medical billing rules. The manual might state, "If the patient is under age 18 (Section 4.1), you must apply the pediatric modifier and ignore the standard adult billing rate (Section 9.2)." To succeed, the model must isolate the age constraint from the hundreds of pages, hold that condition in active memory, and then suppress the standard billing instruction even when the later text tempts it with common adult coding patterns. Because the model must chain these dependencies accurately, missing or misinterpreting the initial constraint renders the entire downstream sequence incorrect. In practice, this looks like a model identifying the correct patient data but failing to override its own habit of applying the standard rate, simply because the "18 years old" signal grew quiet against the noise of later text.

Domain Metric Model Strategy Performance
ICD-10-CM Coding Exact Match Agentic/RAG/ReAct/Baselines 1.0%
Federal Sentencing Exact Match Agentic/RAG/ReAct/Baselines 15.5%

The Limits of Current Retrieval

Current retrieval-augmented generation (RAG) techniques struggle to maintain state across branching logic. These systems treat document chunks as independent sources of information. In a transformer, the attention mechanism calculates relationships between tokens through a softmax function that assigns a probability distribution across the entire context window. This mechanism inherently prioritizes local tokens that appear frequently in the query-response cycle, forcing the total attention weight to sum to one. As the context window becomes crowded with pages of procedural text, the 'signal' for a critical, early-defined constraint becomes diluted. The architecture computes weighted averages rather than enforcing hard logical conditions. A hard logical constraint would act as an immutable gating mechanism; if the 'age < 18' flag is true, the probability of selecting the 'adult rate' token would be mathematically clamped to zero regardless of how many times the model has seen that token in training data. Current transformers possess no such gated circuitry, so they drift toward the statistically probable output instead of the logically necessary one.

Bridging the Gap

We need architectures that treat state as a persistent, mutable object—essentially an external key-value store or a formal scratchpad memory. In this model, the forward pass would be interrupted by an interface layer. Before generating the next token, the model would query this external store; if a constraint is found, the system would inject that value directly into the model's logits, masking any other probability. This forces the model to ignore its own internal statistical distribution in favor of the external rule. Current fine-tuning techniques on long-horizon datasets fail to close this performance gap, indicating that simply increasing parameter counts or adjusting prompting strategies does not fix the underlying inability to manage complex, multi-step constraints. Builders should treat these models as unreliable for tasks that require strict adherence to multi-hop logical paths until better methods for external state tracking are integrated. It remains unclear whether fine-tuning methods can eventually force the model to respect these boundaries without explicit external gating, or if the loss function simply lacks the signal to penalize these specific failures during training.

Sources