TL;DR
LLM-based agents often waste massive amounts of computational overhead by reading long business policy documents in-context for every single turn. This paper introduces Category-Aware Policy Continued Pretraining (CAP-CPT), a method that bakes these complex rules directly into the model's weights, slashing prompt lengths by up to 97.3% while significantly boosting task success rates.
What Problem Does This Paper Address?
When deploying LLM agents in the real world (e.g., as airline booking assistants or customer support agents), they must strictly adhere to complex business policies. Currently, developers pass these massive policy documents directly into the LLM's prompt context. As business rules expand, these prompts can balloon up to 50,000 tokens, dominating computational costs and slowing down inference.
To solve this, researchers have tried "internalizing" policies into the model's parameters using Supervised Fine-Tuning (SFT) on interaction trajectories. However, the authors find that standard SFT is incredibly data-hungry and fails catastrophically when policies contain complex, nested logical workflows.
Methods
The authors propose a two-part solution: a framework to measure policy complexity and a targeted training pipeline to internalize it.
- CC-Gen (Controllable Complexity Generator): A benchmark generator that synthesizes policy documents and paired agent tasks across four distinct dimensions of complexity: environmental, task-level, workflow, and user query.
- CAP-CPT (Category-Aware Policy Continued Pretraining): Instead of treating a policy document as a uniform block of text, an automated LLM pipeline breaks it down into four distinct categories:
- Factual: Simple facts requiring accurate recall (e.g., "Refunds take 5-7 days").
- Behavioral: General rules of conduct (e.g., "Always ask for user confirmation before updating a database").
- Simple Conditional: Straightforward if-else rules.
- Complex Conditional: Hierarchical, multi-branch nested logic (e.g., baggage allowances based on tier, class, and destination).
For each category, the pipeline generates tailored training data (paraphrases, QAs, role-model demonstrations, and extensive scenario simulations). The model then undergoes Continued Pretraining (CPT) using an autoregressive language modeling loss on this synthesized data before a final light SFT step.
Datasets
The approach was evaluated using two primary datasets:
- CC-Gen: The newly introduced synthetic benchmark, configured into 12 different settings to isolate the impacts of task-level and workflow-level complexities.
- $\tau$-Bench (Tau-Bench): A challenging, real-world user-agent-tool interaction benchmark representing retail and airline domains.
Key Insights and Ideas
- Workflow Complexity is the Real Killer: Through their controlled benchmark, the authors discovered that environmental complexity (the size of the database) barely impacts performance. Instead, workflow complexity (nested if-else structures) causes the sharpest drops in agent reliability.
- Rote Memorization vs. Operationalization: Standard CPT data focuses on memorizing text via paraphrases. CAP-CPT succeeds because its "scenario simulation" data forces the model to execute the rules during pretraining, transforming abstract constraints into concrete parametric workflows.
- The Fragility of Strong Priors: Surprisingly, highly capable models like Qwen-3-32B are sometimes more rigid and prone to catastrophic forgetting or interference during internalization than slightly weaker models (like Qwen-2.5-32B), which adapt more flexibly to the targeted CPT data.
Key Results
- Massive Context Compression: Replacing full policy documents with a simple unique policy identifier (e.g.,
<#Policy-1356X>) reduced the input prompt length by up to 97.3%. - Performance Boosts in Data-Sparse Settings: When training data was limited (only 1K SFT samples), CAP-CPT boosted the success rate of Qwen-3-32B by 41% compared to the SFT baseline.
- Handling High Complexity: Under the most challenging workflow settings, CAP-CPT yielded a 22% performance gain on Qwen-3-32B.
- Real-World Validation: On $\tau$-Bench, the full pipeline surpassed the in-context prompting baseline (achieving a 28.70% success rate vs 26.96%) while simultaneously shaving 34.8% off the total input token length.
Limitations and Future Work
While a major step forward for prompt optimization, the authors note several limitations:
- Scope Constraints: The current evaluation framework is restricted to text-only, single-turn agent tasks. Real-world applications often require multi-turn repairs and multimodal inputs (like processing receipts or screenshots).
- Brittleness to Dynamic Changes: The models still struggle with tasks that require dynamic policy modifications at runtime, such as full policy substitutions or partial overrides.
- Lack of RL Alignment: The training recipe currently stops at CPT + SFT. Integrating Reinforcement Learning (RL) methods like PPO or GRPO on top of the generated trajectories remains an open and promising direction.
Summary updated