Advertisement

Active Hackathon

Why Amit Sharma created DoWhy

The accepted best practices for formulating and validating assumptions that we would hear from experts were not written down anywhere. So, my collaborator Emre Kiciman and I thought: Why not create a library for Causal Inference that enabled these best practices for everyone?
Amit Sharma DoWhy
Listen to this story

“Data tells stories. My research aims to tell the causal story,” proclaims Amit Sharma, a researcher at Microsoft and the developer of software library DoWhy (2018). This year, this library was in the news when Microsoft moved DoWhy to an independent open source governance model in a new PyWhy GitHub organisation.

Analytics India Magazine caught up with Sharma for a quick chat about PyWhy, Causal Inference, and more.

THE BELAMY

Sign up for your weekly dose of what's up in emerging technology.

 

AIM: Let’s begin by getting a peek into your early years and professional journey. 

Amit Sharma: I did my graduation in engineering from IIT Kharagpur. While studying there, I got a chance to intern at industry and university labs that exposed me to the process of research. I was acquainted with a few PhD students and liked how they were all trying to solve tough problems with many unknowns. And the best part was they were being paid to study and research – the idea fascinated me. So, I applied for PhD programs and got through the Computer Science department at Cornell University. 

My advisor Dan Cosley was in the Information Science department. Hence, I had the advantage of taking courses and interacting with students from both departments. While Computer Science focuses on the design of technology systems, Information Science studies how these systems interact with society. This dual experience changed my outlook. Initially, I wanted to build systems that would help people, but I gradually learnt that it is equally important to reflect on whether I really know what will help people and what are ways to confirm my hypothesis. In other words, the ability to ask the right question is often as important as coming up with the best answer to a question.

I am now working as a principal researcher at Microsoft Research in India. I try to merge the ways of thinking in what I do – causal inference and technology for mental health.

AIM: To whom (or what) do you credit your interest in Causal Inference?

Amit Sharma: My first encounter with Causal Inference was during an internship at LinkedIn, where I was working to improve LinkedIn’s recommendation algorithm. I was struck by my team’s dependence on conducting a randomised A/B experiment to test a new algorithm, even though there were many established accuracy metrics that could be computed from log data. That felt wasteful, so I went up to my manager and asked, “why not evaluate algorithms offline using the log data? That will be so much faster”. He said, “We’ve tried that before. You’ll be lucky if offline evaluation provides the right direction of estimates, let alone an accurate answer.” I was intrigued. Something felt wrong here, but I didn’t know how to express it and moved on.

A few years later, during an internship at Microsoft Research, my collaborators helped me find the answer: Causal Inference. Turns out that causality has been an important topic in

statistics, economics, and the biomedical sciences, but it found very little attention in Computer Science at the time. And it could perfectly explain the A/B test riddle. The issue was that we wanted to find the causal effect of any new recommendation algorithm, but the offline accuracy metrics were not correctly set up to measure that (and as I learnt later, it is tough to set them up to measure the causal effect). But the really interesting part was that it was not just A/B testing versus offline evaluation or about finding the impact of a recommender system, the principles of causal inference apply to all decision problems from healthcare to economics. I started reading more about causality, especially from Judea Pearl’s writings and got hooked.

AIM: You built the DoWhy library. Tell us about the whole process of development.

Amit Sharma: Well, even though I was excited about the topic, it was very difficult to learn about Causal Inference. Back in 2015, the best resources were statistics textbooks or the Causality book from Judea Pearl. None were accessible to me. I spent a good part of 2015 trying to understand what these books were saying. 

At the outset, it looked like there was no agreement on the best way to do a causal analysis. But the more I read and worked with data, I realised that all causal analysis problems boiled down to four steps. They were the same steps repeated in each project, but these details were often skipped when presenting the analysis. The accepted best practices for formulating and validating assumptions that we’d hear from experts were not written down anywhere. So, my collaborator Emre Kiciman and I thought: Why not create a library for Causal Inference that enabled these best practices for everyone? 

The four steps are: model the world knowledge, identify whether a causal quantity is estimable given the knowledge, estimate the quantity if so, and finally refute or validate the obtained estimate. These four steps form the core API verbs of the DoWhy library we built. Before DoWhy, most software for causality focused only on the estimation step. But the other steps are equally important. As we designed the DoWhy library, we wanted to convey that Causal Inference is not like predictive machine learning, where you start with data. Here, you need to start with assumptions that you are willing to take on the data-generating process. If you make the wrong assumptions, no amount of data modelling will save you. Therefore, DoWhy’s focus is on setting up and validating assumptions of a causal analysis.

AIM: How do you see DoWhy evolve? 

Amit Sharma: The response has been heartening. In a short time, DoWhy has been installed over 1.3 million times. It is being used as a teaching tool in universities, in research papers, and in answering various business questions in the industry. Going forward, we will continue to add better ways to validate the Causal Analysis. DoWhy is also moving towards other causal tasks: in addition to effect estimation, we are extending it to attribution, prediction and counterfactual estimation using the same four-step API.

We’ve just recently moved DoWhy to an independent Github organisation, py-why, so DoWhy is now an open-source, community-led project. If you are interested, feel free to join the community on Discord. We welcome your contributions! 

AIM: Your work revolves around using modern algorithms as interventions. Please elaborate.

Amit Sharma: Around the time that I started working on causality in online systems, there was a growing concern about algorithmic decision-making systems in critical domains such as finance, education and governance. I realised that we are quickly moving away from a world where technology helped people do a task to where systems are making important decisions that can affect people’s lives. This is a paradigm shift. Consider an algorithm used by a bank to decide on loan applications or a governmental algorithm to distribute aid. Such algorithms are not just passive prediction algorithms, they are coming in and making decisions with real consequences for the people involved. And their effects can be massive.

So, two questions come to mind: 

1) How do we measure the impact of these systems? 

2) How can we design such systems for better impact? 

These questions are not too different from the evaluation of medical treatment or economic policy (that’s why the term algorithmic interventions) where causal inference has historically been applied. How do we do the same in computing systems?

AIM: Right, so what are you working on now?

Amit Sharma: I am working on developing better ways to validate causal models from data. That remains an open question, so advances here can accelerate the progress in building causal models, like what cross-validation did for machine learning. The other direction that I’m interested in is how causality can help machine learning systems become more robust and trustworthy. I am developing techniques that use interventional input examples to interpret the patterns learnt by a predictive ML model (see the DiCE project), evaluate its fairness with respect to people’s expectations and improve the ML model. I am also fortunate to be associated with the Center for Societal Impact through Cloud and AI (SCAI) at Microsoft Research, where I’m working to see how such models can be responsibly deployed in sensitive contexts. I’m also working with clinical psychologists from NIMHANS on a mental health app, MindNotes, that aims to reduce stigma around mental health and encourage more people to seek help.

AIM: What resources would you suggest to those interested in knowing more about Causal Inference?

Amit Sharma: Compared to predictive machine learning, causal inference requires a different thought process and can have a steep learning curve. So I would like to suggest a few learning resources:

1) It’s best to start with the Book of Why to understand the basic concepts.

2) If you like to go deeper into the context of computing systems, you can check out the draft book, Causal Reasoning: Fundamentals and machine learning applications, that I’m co-writing. The first chapter describes how causality, out-of-distribution predictive generalisation, and reinforcement learning are all connected.

3) If you prefer videos, you may check out this webinar on causal machine learning that includes a sample analysis with the DoWhy library.

More Great AIM Stories

Shraddha Goled
I am a technology journalist with AIM. I write stories focused on the AI landscape in India and around the world with a special interest in analysing its long term impact on individuals and societies. Reach out to me at shraddha.goled@analyticsindiamag.com.

Our Upcoming Events

Conference, Virtual
Genpact Analytics Career Day
3rd Sep

Conference, in-person (Bangalore)
Cypher 2022
21-23rd Sep

Conference, in-person (Bangalore)
Machine Learning Developers Summit (MLDS) 2023
19-20th Jan, 2023

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
21st Apr, 2023

Conference, in-person (Bangalore)
MachineCon 2023
23rd Jun, 2023

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM
MOST POPULAR