Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

The AI Practitioner Podcast

The AI Practitioner Podcast artwork

PODCAST — Score-Based Causal Discovery with LLMs

May 20, 202615 minAudio
ShareXLinkedInFacebookWhatsAppEmail

Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. Constraint-based methods discover causal graphs by testing independences. Score-based methods take a different route. They treat causal discovery as a model selection problem, scoring candidate graphs and searching for the one that best balances fit and complexity. In this episode, we explore how score-based algorithms learn causal structure, why they hit the same identifiability ceiling as constraint-based methods, and how LLMs can be plugged into the search itself rather than just bolted on at the end. You’ll learn: * How score-based methods differ from constraint-based ones: why framing causal discovery as model selection changes both the search procedure and the kinds of errors the algorithm makes. * Where LLMs can intervene in score-based pipelines: the five integration points, from hard constraints to iterative agentic loops, and which ones are recoverable when the LLM is wrong. * How to pick the right algorithm and LLM integration strategy: comparing priors, post-hoc orientation, and score augmentation on the Adult Census Income dataset, and what each one is worth in practice. By the end, you’ll have a clear view of where score-based methods sit relative to constraint-based ones, and a practical map of how to combine statistical search with LLM-derived priors without letting the LLM override the data. If you’d rather read than listen, the full article (with diagrams, code examples, and implementation details) is available on Substack: 👉 Enjoyed this episode? Subscribe to The AI Practitioner to get future articles and podcasts delivered straight to your inbox. Get full access to The AI Practitioner at aipractitioner.substack.com/subscribe

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

SPEAKER_02Welcome back to the AI Practitioner. I'm Lina Faik, an engineer, consultant and lecturer in Advanced Machine Learning at Sorbonne University. I've helped companies turn their data into real outcomes with AI, and this is where I share what I learned from actual projects. The deep technical write-ups live on Substack at aippractitioner.substack.com, and these conversations are the audio companion. With me today is Alex, an ML engineer who's been working a lot on forecasting and explainability lately,

SPEAKER_02but hasn't gone deep into causal discovery yet. So this is going to be a useful filter for whether any of this lands.

SPEAKER_01Happy to be back. So, what's on the table today?

SPEAKER_02Picture this. A few months ago, I'm in a review meeting with a client. We've shipped a forecast, the metrics look good, and somebody on their side asks me, okay, but why did Q3 underperform? And I had a beautiful correlation matrix. I had sharp values. I had a model that fit. And I had no real answer to the question they actually cared about.

SPEAKER_01Ouch. Yeah, and that gap between what predicts and what causes is where causal discovery lives.

SPEAKER_02The last time we talked, I walked through the constraint-based side, the algorithms that work by testing conditional independences. Today is the other half of the picture, score-based methods, plus how large language models actually fit into that workflow.

SPEAKER_01Hold on, though. Why do we even need a different approach? Constraint-based methods exist. They have nice statistical guarantees. What's wrong with them?

SPEAKER_02Nothing in theory. The problem is they're brittle in practice. They run a sequence of independence tests, and errors early in that sequence propagate down the rest. With noisy or high-dimensional data, performance degrades fast. Score-based methods sidestep that. Instead of testing independences directly, they assign a score to candidate graphs and search for the structure that best explains the data.

SPEAKER_01So it's a model selection problem.

SPEAKER_02Exactly. You're picking the best graph the same way you'd pick the best regression model. Some graphs are too simple and miss real relationships. Some are too dense and start fitting noise. The score balances those two pressures. And what's the actual score, or is that one of those things we should leave to the article? The most common one is BIC, the Bayesian Information Criterion. You can think of it as having two terms. One rewards how well the graph fits the data, The other penalizes how many edges you've added.

So adding an edge has to earn its keep, improve the fit by more than the complexity cost.

SPEAKER_02I'll skip the equations on Mike. They're laid out in the article.

SPEAKER_01Right. So how does the algorithm actually search? Because the number of possible graphs has to explode.

SPEAKER_02It does. With 10 variables you already have more than 4 times 10 to the 18 possible DAGs. You can't enumerate them. So score based methods all use approximate search. And there are three main families. That's actually a useful way to organize the landscape.

SPEAKER_01Lay them out.

SPEAKER_02First family is greedy combinatorial search. The classic algorithm here is GES . It starts from an empty graph, adds the edge that most improves the score, keeps going, then has a second phase that prunes any edges that turned out to be spurious. Very interpretable. You can watch it work. Continuous Optimization This is the more recent family. Not yours was the breakthrough paper, 2018. Instead of treating the graph as a combinatorial object,

you represent it as a weighted matrix and minimize a loss function with gradient

SPEAKER_02descent. The clever trick is a smooth acyclicity constraint, a function that's zero exactly when the graph is a DAG. That makes the whole thing differentiable.

SPEAKER_01Differentiable graphs. That's the kind of sentence that would have sounded insane 10 years ago.

SPEAKER_02Huh, yeah. The trade-off is that the output isn't a clean graph. It's a weighted matrix where small values cluster near zero and you have to threshold, which introduces its own judgment call.

SPEAKER_01And the third family.

SPEAKER_02Permutation-based search. Instead of searching over graphs directly, you search over orderings of the variables. Once you fix an ordering, say A comes before B comes before C, Building the best graph that respects that order is much easier, because each variable can only have parents that came before it. So you reduce the problem to find the best ordering. That's Boss and GRSP Andrews et al. 2023. Okay, so we have three families, different trade-offs,

all optimizing some score.

SPEAKER_01What's the catch?

SPEAKER_02They all eventually hit the same wall. And it's not an algorithm problem. It's structural.

SPEAKER_01Markov equivalents.

SPEAKER_02Yes. Multiple different causal graphs can encode exactly the same set of conditional independences, which means they produce exactly the same likelihood, which means any score derived from observational data alone gives them the same number. You cannot distinguish them.

SPEAKER_01I want to push back on this for a second. Isn't that just a sample size problem? Run more data through it. The score gets sharper. The right graph wins.

SPEAKER_02That's the natural intuition, and it's wrong. More data doesn't help. A better score doesn't help. The information you need to break the tie literally isn't in the observations. The two graphs are observationally indistinguishable by construction.

SPEAKER_01Hmm. Okay. That's actually kind of profound. So where do LLMs come in?

SPEAKER_02They come in exactly there. The missing information has to come from outside the data. And LLMs are this enormous repository of how the world tends to work, at least according to the text they were trained on. So the idea is to use that external knowledge to break ties that statistics can't resolve.

SPEAKER_01How? Like you just asked GPT which way does the arrow go?

SPEAKER_02That's the simplest version. But the more interesting question is where in the pipeline you inject the LLM. Because score-based methods give you a much richer integration surface than constraint-based ones. The objective is an explicit number. You can modify that number at several points.

SPEAKER_01Walk me through the points.

SPEAKER_02Five of them. And this is the bluntest version. You ask the LLM to generate hard constraints. Forbidden edges, required edges. The search just respects them. The advantage is simplicity. The downside is rigidity. If the LLM forbids an edge that's actually true, the algorithm can never recover it. The mistake is permanent.

SPEAKER_01Risky

SPEAKER_02The second is to use the LLM to initialize the search. Give GES a starting graph, give NotYours a starting matrix, give a permutation method a starting ordering. The score function doesn't change, but the trajectory does. And since these methods are sensitive to where they start, a good initialization helps both speed and final quality.

SPEAKER_01And if the LLM gets the init wrong?

SPEAKER_02That one's recoverable. The search can move away from a bad starting point. So it's softer than hard constraints Okay, third Third is the one I find most interesting You modify the score itself The algorithm doesn't optimize pure BIC It optimizes BIC plus an LLM derived prior So for each edge, the LLM gives you a confidence that the edge should exist Positive for endorsed, negative for rejected, zero for I don't know You add that to the score, weighted by a hyperparameter So the data and the LLM are in a

tug of war Exactly And the nice property is that if the data has strong evidence against what the LLM

SPEAKER_02said, the data wins. The LLM is a soft prior, not a veto.

SPEAKER_01Okay, that I like. Fourth.

SPEAKER_02Post-hoc orientation. You run the algorithm, untouched. It gives you back a CP DAG, a partially directed graph, with some edges still ambiguous because of Markov equivalence. Then you hand only the unresolved edges to the LLM and ask it to orient them. The data did everything it could. The LLM only fills the gaps that the data structurally cannot fill.

SPEAKER_01That's clean.

SPEAKER_02It is. And it's also the safest in some ways, because the LLM can't invent edges or remove edges that statistics validated. It only intervenes at the boundary of what observational data can decide.

SPEAKER_01Fifth.

SPEAKER_02Iterative agentic loop. The newest pattern. You let the LLM propose modifications. Add this edge, remove that one, reverse this direction, and the score function acts as the verifier. If a proposed modification improves the score, you keep it. If not, you reject it. It's a dialogue between the LLM and the data, refereed by the math.

SPEAKER_01I want to be skeptical of that one for a second, because that pattern LLM proposes, verifier accepts or rejects is everywhere right now, and in a lot of domains it sounds great in theory and degenerates in practice into the LLM proposing the same three things in a loop.

SPEAKER_02That's a fair critique, and the literature is honest about it. The papers that work, causal modeling agent, co-scientist, they put real engineering into the proposal and verification cycle. Constraints on what kinds of moves are allowed, stopping criteria, diversity in the prompts. The agentic loop isn't free. It works, but only when the loop is designed carefully. Okay, so out of those five, in practice, which one have you actually used? I use different ones in different situations.

The article has a comparison of what's recoverable if the LLM is wrong and what isn't.

SPEAKER_02Worth reading before you pick. But for the experiments in the article, I ran three of them on a real dataset.

SPEAKER_01Which dataset?

SPEAKER_02Adult census income, same one I used in the first piece, demographics, income, education, occupation. The reason that data set is useful is it has three different types of variables. There are immutable ones, age, sex, there are naturally ordered ones, education comes before, occupation comes before income. And then there are messy ones like marital status and relationship, where the causal direction is genuinely unclear.

SPEAKER_01Classic data set.

SPEAKER_02Yeah. And what's interesting is what each integration strategy actually does. Baseline GES on the discrete subset gives you a graph with a lot of undirected edges in the demographic core. The data alone can't orient them. Then I add a hard immutability constraint. Age and sex can't be effects of anything else. That fixes some orientations. But it also leaves some weird ones in place, like income-causing education, which is statistically valid in the equivalence class but semantically nonsense.

SPEAKER_01Because education comes first in time.

SPEAKER_02Exactly. So I run the post-hoc LLM review. It looks at each edge and asks, keep it, remove it, reverse it. And it correctly flips the education income and occupation income directions. The resulting graph looks much more sensible.

SPEAKER_01Sensible to a human reader, you mean.

SPEAKER_02Right. And that's the catch I want to flag. The LLM never saw the data. It's reasoning purely from the variable names and what it knows about the world. Which works well here because education, income, occupation are familiar concepts. But if your variables are domain specific or counterintuitive, the LLM can be confidently wrong. So this is a place where I'd use it as a starting point, and then have a domain expert validate the orientations.

SPEAKER_01Hold on. That's a real concern. If the LLM is just doing common sense reasoning over variable names, what's it actually doing that a careful researcher with a whiteboard couldn't?

SPEAKER_02Honestly, in small problems with familiar variable names, not much. The LLM is a scalable replacement for a domain expert sitting in the room. The argument for it is when you have hundreds of variables, or you're working through ten different datasets in a quarter, or you genuinely don't have the expert available. At that scale, good enough automated common sense beats no common sense at all. But in a high-stakes setting with five variables and an expert in the next chair, just ask the expert.

SPEAKER_01Fair. I also run a comparison across the three search families on the continuous subset.

SPEAKER_02GES, GRSP, NoteYours, and the takeaway there is they don't agree. GES and GRSP recover similar skeletons. They're both score-based, they both work in equivalence classes, so that makes sense. But NoteYours returns a fully directed graph because the continuous formulation doesn't have an equivalence class step. Every edge gets a direction, even when the statistical evidence is weak.

SPEAKER_01So not yours is more confident than the data warrants.

SPEAKER_02That's one way to read it. Or you can say it's more committed. It's a real difference in what the output means. A CP DAG from GES tells you here's what I'm sure about, here's what's ambiguous. A not yours DAG just gives you arrows. That's a real thing to know before you put a graph in front of a stakeholder. Yes. And the last experiment in the article modifies the score directly with an LLM penalty matrix. So for every possible directed edge, the LLM gives a plausibility score from 0 to 10, with consistency between the two directions enforced.

SPEAKER_02If x to y is plausible, y to x gets penalized. Then I run GRSP with that penalty added to BDU. I won't unpack the heatmap on Mike, but the article has the full picture.

SPEAKER_01Okay, so if I'm sitting at my desk Monday morning, I've got a real data set, I've got a stakeholder who wants causal questions answered, where do I start? Like, what's the actual first move?

SPEAKER_02Honest answer? Start with the cleanest version. Run GES with BIC, or BDU if your data is discrete. Look at the CP DAG. Identify the edges that are undirected. Those are the places where the data can't tell you the direction. Then, and only then, bring in external knowledge. Hard constraints for the things you're certain about, like immutability. Post-hoc LLM review or expert review for the ambiguous orientations. Don't reach for the full agentic loop on day one. You want to see what the data actually says before you let the

LLM shape the search.

SPEAKER_01So data first, knowledge second.

SPEAKER_02Always. The whole point of causal discovery is to let the data tell you what it can. The LLM is there for what the data structurally cannot tell you. Reverse that order and you're just doing prompt engineering with extra steps.

SPEAKER_01That's a good line. And where can people go deeper on all of this?

SPEAKER_02The full article, Code, Math, the Experiments on Adult Census Income, the references, is on Substack at AIpractitioner.substack.com. The repo with the code is linked there, too. If you want to run the experiments yourself, everything's reproducible. And one thing I'd leave you with. Causal discovery isn't going to replace careful thinking about causal structure. The algorithms are tools. They surface candidate structures. They flag ambiguities. They make the assumptions explicit. The judgment about whether those structures are real,

that still sits with the modeler.

SPEAKER_02The LLMs make the judgment scale. They don't replace it.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. PODCAST — Beyond Static Prompts: Building Self-Improving LLM Agents with ACE

    Nov 19, 202611 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could learn from every interaction...

    Credit the people on this episode

  2. PODCAST — Inside GEPA: Evolving LLM Agent Prompts with Reflective Feedback

    Nov 11, 202611 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could continuously improve their...

    Credit the people on this episode

  3. PODCAST — TextGrad in Practice: Optimizing LLM Agent Prompts with Textual Gradients

    Nov 3, 202615 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could improve their own prompts...

    Credit the people on this episode

  4. PODCAST — Continuously Optimizing AI Agent Prompts in Production

    Oct 28, 202615 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if the key to better AI agents isn’t writing...

    Credit the people on this episode

  5. PODCAST — From Prompt Engineering to Harness Engineering: Where the Real Leverage Moved

    Oct 16, 202613 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if improving an AI agent’s performance had less...

    Credit the people on this episode