- Updated: June 29, 2026
- 8 min read
Managing Procedural Memory in LLM Agents: Control, Adaptation, and Evaluation
Direct Answer
The paper introduces AFTER, a large‑scale benchmark that measures how procedural memory—reusable, step‑by‑step skill scripts—behaves across enterprise tasks, professional roles, and different large language model (LLM) backbones. It matters because it provides the first systematic evidence that procedural memory can be refined once and then transferred, delivering measurable productivity gains in real‑world business workflows.

Background: Why This Problem Is Hard
Enterprises are increasingly deploying LLM‑powered agents to automate repetitive knowledge‑work—drafting emails, generating reports, or triaging tickets. While raw LLMs excel at one‑off generation, they struggle to retain and reuse procedural knowledge across sessions. The core bottlenecks are:
- Task fragmentation: Each workflow is expressed as a separate prompt, forcing the model to rediscover the same sequence of actions every time.
- Model drift: Updates to the underlying LLM (e.g., moving from GPT‑3.5 to GPT‑4) often invalidate hand‑crafted prompts, requiring costly re‑engineering.
- Lack of evaluation standards: Existing benchmarks focus on single‑turn QA or reasoning, not on multi‑step, role‑specific procedures that span minutes or hours of work.
Current approaches—prompt engineering, few‑shot examples, or fine‑tuning on task‑specific data—address only a slice of the problem. They either embed procedural steps directly in the prompt (which is brittle) or rely on expensive model retraining (which limits agility). Consequently, enterprises lack a reliable way to gauge whether a learned skill will survive a role change, a new model version, or a shift in business context.
What the Researchers Propose
The authors present a three‑part framework:
- AFTER benchmark: A curated suite of 382 realistic enterprise tasks, organized into six professional roles (e.g., sales, support, finance) and 22 distinct procedural skills such as “invoice reconciliation” or “customer onboarding.”
- Controlled evaluation settings: Four transfer axes—local improvement, cross‑task transfer, cross‑role transfer, and cross‑model generalization—allow researchers to isolate where procedural memory succeeds or fails.
- Skill evolution pipeline: An iterative refinement loop where agents execute a task, generate a trace (the sequence of actions taken), and then a meta‑learner extracts a distilled procedural script that can be replayed on new inputs.
Key components include:
- Execution Engine: The LLM agent that runs the raw task prompt and records its action trace.
- Trace Aggregator: A system that collects traces from multiple model backbones (e.g., GPT‑4, Claude, Llama‑2) and normalizes them into a common representation.
- Procedural Synthesizer: A lightweight model that abstracts the aggregated traces into a reusable skill script, optionally enriched with role‑specific parameters.
- Evaluation Harness: Automated test suites that replay the synthesized skill on held‑out tasks and report accuracy, latency, and cost metrics.
How It Works in Practice
The workflow can be visualized as a four‑stage pipeline:
- Task Invocation: A user (or downstream system) submits a request such as “Prepare a quarterly expense report for the Marketing department.” The request is routed to the Execution Engine.
- Trace Generation: The engine runs the request using a chosen LLM, logs each sub‑action (data fetch, calculation, template fill), and returns both the final output and the raw trace.
- Skill Extraction: The Trace Aggregator pools traces from several models, then the Procedural Synthesizer abstracts common patterns into a declarative script (e.g., a JSON‑like workflow definition). This script becomes the “procedural memory” for the skill “expense‑report‑generation.”
- Reuse & Transfer: When a new request arrives—whether from the same role, a different role, or a different LLM—the system loads the stored script, injects role‑specific variables, and executes it directly, bypassing the need for a full LLM generation pass.
What distinguishes this approach from traditional prompt engineering is the explicit separation of knowledge acquisition (the trace generation phase) from knowledge application (the script execution phase). By treating procedural memory as a first‑class artifact, the system can:
- Apply a single refinement round to improve a skill across all downstream tasks.
- Swap the underlying LLM without re‑writing prompts, because the script is model‑agnostic.
- Measure transferability quantitatively using the AFTER benchmark’s cross‑role and cross‑model settings.
Evaluation & Results
The authors evaluated the pipeline on the full AFTER suite, focusing on four research questions:
1. Local Improvement
A single refinement iteration—where the Procedural Synthesizer rewrites a skill after observing execution failures—boosted aggregate task accuracy by 3.7–6.7 points across all roles. This gain was consistent regardless of the base LLM, indicating that procedural memory can compensate for model‑specific quirks.
2. Cross‑Task Transfer
Skills trained on a subset of tasks (e.g., “drafting legal contracts”) were reused on unseen but related tasks (e.g., “creating NDAs”). Transfer accuracy averaged 68.4 %, demonstrating that the abstracted scripts capture domain‑level logic rather than task‑specific phrasing.
3. Cross‑Role Transfer
When a skill originated in a “sales” role and was applied to “customer support,” performance varied widely. Broadly applicable skills like “email templating” retained > 80 % accuracy, while highly specialized workflows (e.g., “pipeline forecasting”) dropped below 45 %. This dichotomy highlights the need for role‑aware parameterization.
4. Cross‑Model Generalization
Procedural scripts distilled from a heterogeneous mix of model traces (GPT‑4, Claude, Llama‑2) achieved a **73.1 %** test accuracy on a held‑out model that had never contributed traces. By contrast, scripts derived from a single‑model source peaked at 61 % on the same test. The result suggests that diversity in execution traces yields more robust, model‑agnostic procedural memory.
“Procedural memory is not a static artifact; it evolves with each execution trace, and the diversity of those traces is the primary driver of cross‑model resilience.” – Authors, 2026
Beyond raw numbers, the experiments prove three practical takeaways:
- One‑off refinement is a low‑cost lever for immediate productivity gains.
- Aggregating traces from multiple LLMs creates a “skill ensemble” that outperforms any single model.
- Skill generalization is skill‑dependent; designers must identify which procedures are truly reusable versus role‑locked.
Why This Matters for AI Systems and Agents
For AI product managers and enterprise technology leaders, the AFTER findings translate into concrete design principles:
- Modular Skill Libraries: Build a catalog of procedural scripts that can be invoked via API, reducing latency and token consumption compared with full LLM generation.
- Continuous Refinement Loops: Deploy monitoring that captures execution traces in production, feeds them back into the Procedural Synthesizer, and automatically upgrades the skill set.
- Model‑Agnostic Orchestration: Because scripts are independent of the underlying LLM, you can switch providers (e.g., from OpenAI to an on‑premise model) without breaking downstream workflows.
- Role‑Based Parameterization: Encode role‑specific context (access rights, data sources) as variables in the script, enabling safe cross‑role reuse while preserving compliance.
These principles align directly with the capabilities of the UBOS platform overview, which offers a unified environment for storing, versioning, and executing procedural scripts at scale. The platform’s Workflow automation studio lets teams author skill definitions visually, while the Chroma DB integration provides vector‑based retrieval of relevant procedural memories during runtime.
Moreover, the ChatGPT and Telegram integration demonstrates how a refined procedural script can power a conversational assistant that reliably executes complex ticket‑routing procedures without re‑prompting the LLM each time. This reduces operational costs and improves response consistency—key metrics for any enterprise AI deployment.
What Comes Next
While AFTER establishes a solid baseline, several open challenges remain:
- Dynamic Skill Evolution: Current scripts are static after synthesis. Future work should explore runtime adaptation where the agent can modify the script on‑the‑fly based on real‑time feedback.
- Security & Auditing: Procedural memory may encode privileged actions (e.g., financial transfers). Integrating fine‑grained access control and audit trails is essential for compliance.
- Multi‑Modal Extensions: The benchmark focuses on text‑based workflows. Extending procedural memory to include vision, audio, or sensor data (e.g., “inspect a manufacturing line”) will broaden applicability.
- Benchmark Expansion: AFTER covers six roles; adding domains like healthcare or legal compliance could surface new transfer patterns.
Addressing these gaps will require tighter integration between procedural memory engines and enterprise orchestration layers. The Enterprise AI platform by UBOS already supports plug‑in architectures for security modules, compliance dashboards, and multi‑modal data pipelines, making it a natural testbed for the next generation of skill‑centric agents.
For teams ready to experiment, the UBOS templates for quick start include pre‑built procedural scripts for common HR and finance tasks. Pairing these templates with the UBOS partner program can accelerate proof‑of‑concept deployments and provide access to expert consulting on skill extraction and evaluation.
In summary, the AFTER benchmark and its associated procedural memory pipeline offer a pragmatic roadmap for turning LLM agents from one‑off generators into reusable, adaptable workhorses. By treating procedural knowledge as a first‑class artifact, enterprises can achieve measurable efficiency gains, future‑proof their AI stack against model churn, and lay the groundwork for truly composable AI systems.
For a deeper dive into the methodology and raw data, consult the original arXiv paper. To start building your own procedural memory library today, explore the UBOS homepage and request a demo of the workflow automation studio.