Should I Have Expressed a Different Intent? Counterfactual Generation for LLM-Based Autonomous Control
Amirmohammad Farzaneh, Salvatore D'Oro, Osvaldo Simeone
TL;DR
This work addresses reliable counterfactual reasoning for LLM-based autonomous control in closed-loop agent–environment settings by formulating the problem as a structural causal model (SCM) and introducing counterfactual generation via abduction. The core contribution is conformal counterfactual generation (CCG), which uses test-time scaling and conformal language modeling to produce a reliable set of counterfactual reports $C_\lambda(T,X')$ with a formal guarantee that at least one candidate closely matches the true counterfactual $Y_{X'}(T)$ with probability $1-\epsilon$. The method jointly models the agent and environment, employing a neural posterior $q_\phi(U_Z|A,Z)$ for abduction and Gumbel–Max sampling for token-level decisions, and validates on a 5G network-control case where CG outperforms naive baselines in both KPI fidelity and semantic accuracy. The framework provides actionable reliability guarantees for operator questions like “what if I had expressed a different intent?” and has practical implications for debugging and validating prompt-driven autonomous systems in real-world network control contexts.
Abstract
Large language model (LLM)-powered agents can translate high-level user intents into plans and actions in an environment. Yet after observing an outcome, users may wonder: What if I had phrased my intent differently? We introduce a framework that enables such counterfactual reasoning in agentic LLM-driven control scenarios, while providing formal reliability guarantees. Our approach models the closed-loop interaction between a user, an LLM-based agent, and an environment as a structural causal model (SCM), and leverages test-time scaling to generate multiple candidate counterfactual outcomes via probabilistic abduction. Through an offline calibration phase, the proposed conformal counterfactual generation (CCG) yields sets of counterfactual outcomes that are guaranteed to contain the true counterfactual outcome with high probability. We showcase the performance of CCG on a wireless network control use case, demonstrating significant advantages compared to naive re-execution baselines.
