Built a counterfactual simulator for marketing decisions - here's where the causal semantics break down

Reddit r/ArtificialInteligence Tools

Summary

A counterfactual simulator for marketing decisions combining structural causal models, Hawkes processes, and LLM agents; allows querying 'what-if' scenarios before committing budget. Open source on GitHub.

I've been working on a problem at the intersection of causal inference, simulation, and LLMs that I want to sanity-check with people who've hit similar walls. The problem Most marketing attribution is retrospective. Fit on observed data, back out incrementality. We wanted the inverse: a simulator you query before committing budget. ""What if we shift 30% from creator A to creator B?"" ""What does the engagement decay curve look like if we publish 6 hours later?"" Architecture (three layers, deliberately separated) SCM — structural causal model over creative → creator → platform → user. Lets us do do()-style interventions cleanly. Hawkes processes — for the event-stream side (likes, comments, and shares cluster in time). Self-excitation captures viral cascades better than Poisson. We use it as the temporal backbone for platform dynamics. LLM-driven agents — user archetypes that respond to creative content via a Universal Embedding Bus. The bus is modality-generic, so downstream causal and world modules never touch modality-specific code. Today text-only via an OpenAI-compatible gateway. Image and video stubs land in v0.5. How this relates to existing tools I want to be specific, because ""yet another causal lib"" is a fair first reaction: DoWhy / EconML / causal-learn are estimation and discovery libraries. Given observational data, recover effects or graphs. Oransim assumes you already have (or will define) the graph and focuses on simulating interventions on it. DoubleML / CausalML target ATE and CATE estimation on tabular data. We're oriented toward decision simulation with rich event streams and content embeddings. Generative Agents (Park et al.) is the closest spiritual predecessor for the souls layer, but we're plugging agents into an SCM rather than running them as the whole simulation. Where I'm genuinely uncertain (this is the part I want torn apart) Combining SCMs and LLM agents is theoretically messy. SCMs want clean intervention semantics; LLM agents are stochastic black boxes whose responses depend on prompt, context, and sampling temperature. Our current factoring treats soul outputs as a noisy observation layer feeding into the SCM. Agents generate engagement-like signals that the SCM consumes as endogenous variables. I'm not confident this is the right boundary. Specifically: Identifiability gets shaky once an LLM mediates a node. Interventions on prompts are not the same as interventions on latent user state. Hawkes parameters fit on agent-generated data do not necessarily match real-world parameters even when the marginal distributions look similar. If anyone here has thought about the SCM/LLM-agent interface, I'd really like to hear what you'd do differently. Honesty about the demo data The OSS ships a synthetic dataset calibrated to public-report CTR/engagement ranges. Every code path runs out of the box, but predictions on it are not real predictions. They're for testing the pipeline. Real use needs your own data via the DataProvider interface. Repo: https://github.com/OranAi-Ltd/oransim — Apache-2.0, Python."
Original Article

Similar Articles

Simulate, Reason, Decide: Scientific Reasoning with LLMs for Simulation-Driven Decision Making

arXiv cs.AI

Researchers from the University of Michigan introduce MechSim, a mechanism-grounded neuro-symbolic reasoning framework that enables LLM agents to reason about the internal assumptions, dependencies, and execution behavior of scientific simulators rather than treating them as black boxes. The framework improves explanation quality and decision-making reliability across high-stakes domains like healthcare, finance, and public policy.

HawkesLLM: Semantic Uncertainty Propagation in Agentic Text Simulation

arXiv cs.CL

This paper introduces HawkesLLM, a framework that models semantic uncertainty propagation in multi-step agentic text simulations by combining a multivariate Hawkes process for temporal influence and memory selection with a language model for text generation. Evaluation on a GDELT news-cascade case study shows improved late-stage semantic alignment under compact prompt-memory constraints.

LLM Explainability with Counterfactual Chains and Causal Graphs

Hugging Face Daily Papers

This paper proposes a four-phase method for constructing causal graphs that model LLM inference processes, using counterfactual augmentation to enable stable causal discovery and provide transparent, concept-level explainability.

Causal Discovery in the Era of Agents

Hugging Face Daily Papers

This paper argues that language model agents should assist causal discovery workflows by providing contextual support and explanations rather than generating causal conclusions, and introduces causal-learn+ platform to demonstrate this principle.