Experimentation

Comprehensive Guide to Online Experimentation and Causal Inference

From epidemiological foundations to modern adaptive algorithms - A systematic path to mastering A/B testing, Multi-Armed Bandits, and causal inference

Experimentation
저자

Kwangmin Kim

공개

2025년 11월 10일

1 Experimentation

시작점 — 학습 로드맵

처음 방문이라면 Experimentation 학습 로드맵 — 역학에서 인과추론·A/B Test 까지 를 먼저 읽는다. 11 Phase × 7 교재 매핑과 독자 유형별 진입점을 5 분 안에 파악할 수 있다.

  • 실험 설계와 인과추론의 체계적 이해를 위한 구조화된 학습 경로를 제시
  • Epidemiology 기반 지식을 활용하여 A/B Testing과 Multi-Armed Bandit을 포함한 Experimentation 전반을 학습할 수 있도록 구성

1.1 Experimentation 하위구조

  • Experimentation
    • Epidemiology
    • AB_test
    • Fundamentals
    • MAB (Multi-Armed Bandit)
    • Causal_Inference
    • Advanced
    • Platform

1.2 Learning Path

Epidemiology → Classical A/B Testing → Multi-Armed Bandits → Advanced Methods 순서로 실험 설계와 인과추론을 체계적으로 정리

1.2.1 Core Concepts Connection Map

Epidemiology RCT → A/B Testing → Sequential Testing → Adaptive Testing → MAB
       ↓              ↓                                        ↓
Causal Inference → DAG/SUTVA ────────────────────→ Interference Handling
       ↓              ↓                                        ↓
Effect Measures → Lift/Uplift ──────────────────→ Heterogeneous TE
       ↓
Sample Size → Power Analysis → Sequential Monitoring → Variance Reduction

1.2.2 Key Mathematical Connections

Epidemiology Experimentation 수식
Relative Risk Lift \(\frac{P(Y=1|T=1)}{P(Y=1|T=0)}\)
Risk Difference Absolute Uplift \(P(Y=1|T=1) - P(Y=1|T=0)\)
NNT Number to Convert \(\frac{1}{RD}\)
Effect Modification HTE \(E[Y(1)-Y(0)|X]\)

1.3 Foundations

1.3.1 Epidemiology Foundations

RCT(무작위 대조 시험)는 A/B Testing의 직접적 원형이며, 인과추론의 수학적 프레임워크(Potential Outcomes, SUTVA)가 실험 설계의 이론적 기초를 제공한다. 역학의 effect measures(RR, RD, NNT)는 디지털 실험의 lift와 uplift 지표로 직접 대응되며, bias와 confounding 개념은 실험의 타당도를 판단하는 핵심 도구다. Sample size와 power 계산은 모든 실험 설계의 출발점이다.

1.3.2 Phase H — Statistical Modeling (Woodward lens)

통계 모델링을 실험 분석 lens 로 정리한 시리즈. Logistic regression, Cox/Survival, Meta-analysis, Risk Scores·ROC 의 4 챕터 분해 (총 37 편). Statistics 카테고리의 GLM·Survival·LDA 시리즈와의 cross-link.

1.3.3 Study Design Series

역학과 임상시험에서 정립된 연구 설계 체계를 IT 실험 설계와 연결하여 정리한 시리즈다. 연구 설계의 대분류, 각 설계의 상세, 타당성과 편향, RCT, 관찰 연구, 준실험 설계, 인과 추론 프레임워크를 포괄한다.

1.3.4 Statistical Foundations

가설 검정의 Type I/II 오류와 statistical power 개념은 실험 결과 해석의 필수 요소다. Multiple testing problem은 여러 지표를 동시에 평가하거나 중간 결과를 확인할 때 발생하는 false positive를 통제하는 방법을 제공한다. Effect size와 MDE(최소감지효과) 이해 없이는 실무적으로 의미 있는 실험 설계가 불가능하다.

관련 참조: 가설 검정, GLM, 분포 이론 등 통계 기초는 Statistics 섹션을 참고한다. 특히 GLM (일반화선형모형)은 실험 분석에서 핵심적으로 활용된다.

1.3.5 Classical A/B Testing Fundamentals

디지털 제품에서 RCT 원리를 적용하는 구체적 방법론이다. Randomization unit 선택, traffic allocation, metric selection 등 실무적 의사결정 프레임워크를 제공한다. Fixed-horizon testing의 원칙과 “peeking problem”을 이해해야 sequential testing과 MAB의 필요성을 정확히 파악할 수 있다. 대부분의 실무 실험이 이 방법으로 진행되므로 가장 실용적이다.

1.4 Core Methods

1.4.1 Advanced A/B Testing

Sequential testing은 실험 진행 중 중간 결과를 확인하면서도 Type I 오류를 통제하는 방법으로, 실무에서 가장 많이 요구되는 기술이다. Bayesian A/B testing은 “승률 확률” 같은 비즈니스 친화적 해석을 제공한다. Multi-variate testing은 여러 요소의 상호작용 효과를 동시에 평가할 수 있어 복잡한 제품 최적화에 필수적이다.

  • Advanced A/B Testing Techniques
    • 1111-11-11, Sequential Testing
      • 1111-11-11, Group Sequential Designs (그룹순차설계)
      • 1111-11-11, Sequential Probability Ratio Test (SPRT)
      • 1111-11-11, Alpha Spending Functions
      • 1111-11-11, Always-Valid Inference
    • 1111-11-11, Bayesian A/B Testing
      • 1111-11-11, Prior Distribution Selection (사전분포 선택)
      • 1111-11-11, Posterior Probability (사후확률)
      • 1111-11-11, Credible Intervals (신용구간)
      • 1111-11-11, Probability of Being Best
    • 1111-11-11, Multi-variate Testing
      • 1111-11-11, Full Factorial Designs (완전요인설계)
      • 1111-11-11, Fractional Factorial Designs (부분요인설계)
      • 1111-11-11, Interaction Effects (상호작용효과)
    • 1111-11-11, A/A Testing
      • 1111-11-11, Platform Validation
      • 1111-11-11, Sample Ratio Mismatch (SRM) Detection
    • 1111-11-11, Bayesian Hierarchical Models for Experimentation
      • 1111-11-11, Hierarchical Modeling of Treatment Effects (처치효과의 계층 모델링)
      • 1111-11-11, Bayesian Model Checking and Posterior Predictive Checks (모형 점검과 사후예측점검)
      • 1111-11-11, Bayes Factor for Model Comparison (모형 비교를 위한 베이즈 인자)

1.4.2 Causal Inference Framework

Potential outcomes와 DAG는 “왜 무작위 배정이 중요한가”, “어떤 변수를 통제해야 하는가”에 대한 수학적으로 엄밀한 답을 제공한다. SUTVA 위반(network effects, spillover)은 디지털 실험에서 흔히 발생하며, 이를 감지하고 처리하는 방법이 필요하다. HTE(heterogeneous treatment effects) 분석의 이론적 기초가 되어 “어떤 사용자에게 효과적인가”를 과학적으로 답할 수 있게 한다.

1.4.3 Multi-Armed Bandit Fundamentals

A/B Testing이 “학습 후 의사결정”이라면, MAB는 “학습과 최적화를 동시에” 수행한다. Exploration-exploitation trade-off는 제한된 자원(트래픽)으로 최대 성과를 내는 전략의 핵심이다. Regret 개념은 “실험 비용”을 수학적으로 정량화하여 알고리즘 간 비교를 가능하게 한다.

1.4.4 Classical MAB Algorithms

Epsilon-greedy는 가장 단순하지만 exploration 비율을 수동으로 조정해야 하는 한계가 있다. UCB는 불확실성을 자동으로 정량화하여 exploration을 관리하며, 이론적 regret bound가 증명되었다. Thompson Sampling은 1933년 의학 실험을 위해 개발된 알고리즘으로, 실무에서 가장 성능이 좋고 구현이 간단하여 광범위하게 사용된다.

  • Classical Bandit Algorithms
    • 1111-11-11, Epsilon-Greedy Methods
      • 1111-11-11, Fixed Epsilon Strategy
      • 1111-11-11, Decaying Epsilon Strategy
      • 1111-11-11, Theoretical Regret Bounds
    • 1111-11-11, Upper Confidence Bound (UCB)
      • 1111-11-11, UCB1 Algorithm
      • 1111-11-11, UCB-Tuned
      • 1111-11-11, Bayesian UCB
      • 1111-11-11, KL-UCB
    • 1111-11-11, Thompson Sampling
      • 1111-11-11, Beta-Bernoulli Thompson Sampling
      • 1111-11-11, Gaussian Thompson Sampling
      • 1111-11-11, Theoretical Properties
      • 1111-11-11, Historical Context (의학 실험 기원)

1.4.5 MAB vs. A/B Testing

두 방법의 trade-off를 이해해야 상황에 맞는 선택이 가능하다. A/B Testing은 statistical validity가 명확하고 효과 크기를 정확히 추정하지만, MAB는 실험 중 기회비용을 최소화한다. 비즈니스 목표(정확한 측정 vs. 빠른 최적화), 트래픽 규모, 의사결정 맥락에 따라 최적 방법이 달라진다.

1.5 Advanced Applications (2-3개월)

1.5.1 Phase J — 고급 응용 (28편 완결, 2026-05-09)

Phase J 는 Phase D, E, F 의 종합 응용. HTE (이질적 처치 효과), Quasi-experimental (DiD/RDD), Network spillover (Switchback/Geo), Adaptive trial 의 4 그룹.

1.5.1.1 J.1 — HTE Effect Modification (HER Ch.4, 4편)

1.5.1.2 J.2 — HTE Interaction (HER Ch.5, 4편)

1.5.1.3 J.3 — ML HTE (4편)

1.5.1.4 J.4 — Difference-in-Differences (DiD, 4편)

1.5.1.5 J.5 — Regression Discontinuity (RDD, 4편)

1.5.1.6 J.6 — Switchback / Geo / Spillover (4편)

1.5.1.7 J.7 — Adaptive Trial (4편)

1.5.2 Heterogeneous Treatment Effects

“평균적으로 효과가 있다”는 것과 “모든 사용자에게 효과가 있다”는 것은 다르다. HTE 분석을 통해 어떤 사용자 세그먼트에서 효과가 크고 작은지 파악할 수 있다. Causal forests와 meta-learners 같은 ML 방법은 수백 개의 특성 조합에서 효과 패턴을 자동으로 발견한다. 개인화 전략 수립의 과학적 기반이 된다.

  • 1111-11-11, When to Use MAB vs. A/B Testing
    • 1111-11-11, Trade-offs and Decision Framework
    • 1111-11-11, Statistical Validity Considerations
    • 1111-11-11, Business Context and Goals
    • 1111-11-11, Hybrid Approaches
  • Heterogeneous Treatment Effects
    • 1111-11-11, Subgroup Analysis
      • 1111-11-11, Pre-specified Subgroups
      • 1111-11-11, Multiple Comparison Corrections
      • 1111-11-11, Statistical vs. Practical Significance
    • 1111-11-11, Effect Modification Analysis
      • 1111-11-11, Interaction Terms (상호작용항)
      • 1111-11-11, Stratified Analysis (층화분석)
    • 1111-11-11, Machine Learning Methods
      • 1111-11-11, Causal Forests
      • 1111-11-11, Meta-learners (S-, T-, X-learner)
      • 1111-11-11, Double Machine Learning (DML)
      • 1111-11-11, BART (Bayesian Additive Regression Trees)

1.5.3 Variance Reduction Techniques

동일한 sample size로 더 정확한 추정이 가능하면, 실험 기간을 단축하거나 더 작은 효과를 감지할 수 있다. CUPED는 실험 전 데이터(baseline)를 활용해 분산을 최대 50% 이상 줄일 수 있어 실무에서 표준 기법이 되었다. Stratification과 regression adjustment는 역학에서 검증된 방법으로, 디지털 실험에 직접 적용 가능하다.

  • Variance Reduction Methods
    • 1111-11-11, Pre-experiment Methods
      • 1111-11-11, Stratification (층화)
      • 1111-11-11, Matched Pair Design (대응설계)
      • 1111-11-11, Blocking (블록화)
    • 1111-11-11, Post-experiment Methods
      • 1111-11-11, CUPED (Controlled-experiment Using Pre-Experiment Data) ⭐
      • 1111-11-11, CUPAC (CUPED with Asymptotic Confidence)
      • 1111-11-11, Regression Adjustment (회귀조정)
      • 1111-11-11, Difference-in-Differences (이중차분법)

1.5.4 Contextual and Advanced Bandits

Contextual bandits는 사용자 특성(context)을 고려해 개인화된 의사결정을 내린다. Non-stationary bandits는 시간에 따라 최적 선택지가 변하는 현실을 반영한다. 추천 시스템, 동적 가격 책정, 개인화 마케팅 등 복잡한 실무 문제에 적용된다.

  • Advanced Bandit Methods
    • 1111-11-11, Contextual Bandits
      • 1111-11-11, Linear Contextual Bandits
      • 1111-11-11, LinUCB Algorithm
      • 1111-11-11, Neural Bandits
      • 1111-11-11, Policy Gradient Methods
    • 1111-11-11, Non-stationary Bandits
      • 1111-11-11, Sliding Window Approaches
      • 1111-11-11, Discounted Rewards
      • 1111-11-11, Change Detection Methods
      • 1111-11-11, Switching Bandits
    • 1111-11-11, Structured Bandits
      • 1111-11-11, Combinatorial Bandits
      • 1111-11-11, Dueling Bandits
      • 1111-11-11, Ranking Bandits

1.5.5 Practical Implementation Challenges

이론적으로 완벽한 실험도 실무에서는 metric 정의, novelty effects, network interference, SRM 등 다양한 문제에 직면한다. 이러한 문제들을 감지하고 완화하는 방법을 모르면 잘못된 의사결정으로 이어진다. North star metric과 guardrail metric 설정은 실험 프로그램의 성공을 좌우한다.

  • Practical Experimentation Challenges
    • 1111-11-11, Metric Design
      • 1111-11-11, North Star Metrics (핵심지표)
      • 1111-11-11, Proxy Metrics (대리지표)
      • 1111-11-11, Guardrail Metrics (가드레일지표)
      • 1111-11-11, Long-term vs. Short-term Metrics
    • 1111-11-11, Novelty and Primacy Effects
      • 1111-11-11, Detection Methods
      • 1111-11-11, Mitigation Strategies
    • 1111-11-11, Network Effects and Interference
      • 1111-11-11, Detection of SUTVA Violations
      • 1111-11-11, Cluster-based Approaches
      • 1111-11-11, Graph Cluster Randomization
    • 1111-11-11, Sample Ratio Mismatch
      • 1111-11-11, Detection Methods
      • 1111-11-11, Root Cause Analysis
      • 1111-11-11, Prevention Strategies

1.6 Platform and Specialization (지속적)

1.6.0.1 Experimentation Platform Architecture

실험이 일회성이 아닌 조직의 표준 프로세스가 되려면 확장 가능한 인프라가 필요하다. Assignment service, logging, analysis engine의 설계는 실험의 신뢰성과 효율성을 결정한다. Feature flag integration과 auto-stopping 같은 자동화는 실험 운영 비용을 획기적으로 줄인다.

  • Platform Design and Infrastructure
    • 1111-11-11, Core Components
      • 1111-11-11, Assignment Service (배정 서비스)
      • 1111-11-11, Logging and Tracking (로깅과 추적)
      • 1111-11-11, Analysis Engine (분석 엔진)
      • 1111-11-11, Reporting Dashboard (보고 대시보드)
    • 1111-11-11, Technical Considerations
      • 1111-11-11, Consistent Hashing for Assignment
      • 1111-11-11, Experiment Overlap and Orthogonality
      • 1111-11-11, Feature Flag Integration
      • 1111-11-11, A/A Testing for Validation
    • 1111-11-11, Scale and Automation
      • 1111-11-11, Auto-stopping Rules (자동중단규칙)
      • 1111-11-11, Winner Selection Algorithms
      • 1111-11-11, Multi-objective Optimization

1.6.1 Domain-Specific Applications

제품 최적화, 마케팅, 의료 등 도메인마다 고유한 제약과 요구사항이 있다. Healthcare의 경우 FDA guidance를 따라야 하며, marketplace 실험은 양면 시장의 특성을 고려해야 한다. 도메인 특화 지식이 실험 설계의 성공 여부를 결정한다.

  • Industry Applications
    • 1111-11-11, Product Optimization
      • 1111-11-11, UI/UX Experiments
      • 1111-11-11, Recommendation System Testing
      • 1111-11-11, Search Ranking Experiments
    • 1111-11-11, Growth and Marketing
      • 1111-11-11, Conversion Funnel Optimization
      • 1111-11-11, Pricing Experiments
      • 1111-11-11, Email and Notification Testing
    • 1111-11-11, Healthcare Applications
      • 1111-11-11, Adaptive Clinical Trials
      • 1111-11-11, Response-Adaptive Randomization
      • 1111-11-11, Platform Trials
      • 1111-11-11, Regulatory Considerations (FDA Guidance)

1.6.2 Research Frontiers

RL과의 통합, differential privacy, causal discovery 등은 차세대 실험 방법론이다. Off-policy evaluation은 과거 실험 데이터로 새로운 정책을 평가할 수 있게 하여 실험 비용을 줄인다. 이 분야의 최신 연구를 추적하면 경쟁 우위를 확보할 수 있다.

관련 참조: HTE 분석을 기반으로 한 Agent 개인화 전략은 Agent - Segmentation & Personalization 섹션에서 다룬다. Agent 시스템에서의 사용자 세분화 및 A/B 테스트 적용 사례를 확인할 수 있다.

1.7 Trustworthy Online Controlled Experiments — Kohavi (2020)

Kohavi, Tang, Xu (2020) “Trustworthy Online Controlled Experiments” 의 Part I~V (Ch.4~23) 를 챕터별로 분해한 시리즈 (총 64 편 예정, Phase F). 디지털 실험의 7 대 도전 (OEC, SRM, CUPED, Triggering, Ramping, Leakage, Long-term) 을 정통으로 흡수한다.

1.7.1 Ch.4 — Platform & Culture

1.7.2 Ch.5 — Speed Matters

1.7.3 Ch.6 — Organizational Metrics

1.7.4 Ch.7 — OEC (Overall Evaluation Criterion)

1.7.5 Ch.8 — Institutional Memory and Meta-Analysis

1.7.6 Ch.9 — Ethics in Controlled Experiments

1.7.7 Ch.12 — Client-Side Experiments

1.7.8 Ch.13 — Instrumentation

1.7.9 Ch.14 — Choosing a Randomization Unit

1.7.10 Ch.15 — Ramping Experiments (SQR)

1.7.11 Ch.16 — Scaling Experiment Analyses

1.7.12 Ch.18 — Variance Estimation and CUPED

1.7.13 Ch.19 — A/A Test

1.7.14 Ch.20 — Triggering for Improved Sensitivity

1.7.15 Ch.21 — Sample Ratio Mismatch (SRM) and Trust Guardrails

1.7.16 Ch.22 — Leakage and Interference between Variants

1.7.17 Ch.23 — Measuring Long-Term Treatment Effects

1.8 Design of Experiments — Maxwell·Montgomery (Phase G)

Maxwell & Delaney (2004) “Designing Experiments and Analyzing Data” 와 Das & Giri (1986) “Design and Analysis of Experiments” 의 정통 DOE 체계를 챕터 단위로 분해한 시리즈다 (총 89 편 예정, Phase G). ANOVA 모형 비교, factorial, ANCOVA, repeated measures, multilevel, incomplete block, response surface 를 커버한다. 농학·심리학 사례를 IT multivariate testing · ML 하이퍼파라미터 튜닝 맥락으로 매핑한다.

1.8.1 MAX Ch.6 — Trend Analysis (양적 요인의 추세 분해)

1.8.2 MAX Ch.7 — Two-Way Factorial (이원 요인 설계)

1.8.3 MAX Ch.8 — Higher-Order Factorial (삼원 이상의 요인 설계)

1.8.4 MAX Ch.9 — ANCOVA (공변량으로 분산 감소·편향 보정)

1.8.5 MAX Ch.10 — Random and Nested Factors (임의 효과·중첩 설계)

1.8.6 MAX Ch.11 — Within-Subjects Univariate (반복 측정 단변량)

1.8.7 MAX Ch.12 — Higher-Order Within Univariate (다요인 반복 측정)

1.8.8 MAX Ch.13 — Within-Subjects Multivariate (반복 측정 다변량)

1.8.9 MAX Ch.14 — Higher-Order Within Multivariate

1.8.10 MAX Ch.15 — Multilevel Models (다층 모형)

1.8.11 MAX Ch.16 — Hierarchical Mixed Nested

1.8.12 MON Ch.2 — Complete Block Designs (CRD, RBD, Latin Square)

1.8.13 MON Ch.3 — Factorial Experiments (정통 factorial)

1.8.14 MON Ch.4 — Asymmetrical · Split-Plot Designs

1.8.15 MON Ch.5 — Incomplete Block Designs (BIB, PBIB, Lattice)

1.8.16 MON Ch.6 — Orthogonal Latin Squares (MOLS, Euler 추측)

1.8.17 MON Ch.7 — Bio-assays · Response Surface (생물 검정·반응표면)

1.8.18 MON Ch.8 — ANCOVA · Transformation

1.8.19 MON Ch.9 — Weighing Designs (계량 설계)

1.9 Project: AI Agent A/B Test 실험설계

MINERVA Agent(QnA Chatbot, Data Standardization Helper, Insilico Code Analysis)의 성능 측정을 위한 실험설계 시리즈다. 오프라인 평가부터 프로덕션 동적 라우팅까지 단계적으로 다룬다.

1.10 Analytics Applications

  • 1111-11-11, Conversation Analytics
    • 대화 데이터 분석 및 최적화
    • 사용자 인터랙션 패턴 분석
    • 실험을 통한 대화 품질 개선

1.11 References

Books: - Kohavi, Tang, and Xu (2020). “Trustworthy Online Controlled Experiments” - Lattimore and Szepesvári (2020). “Bandit Algorithms” - Imbens and Rubin (2015). “Causal Inference for Statistics, Social, and Biomedical Sciences” - Pearl and Mackenzie (2018). “The Book of Why”

Papers: - Thompson (1933). “On the likelihood that one unknown probability exceeds another” - Auer et al. (2002). “Finite-time analysis of the multiarmed bandit problem” - Deng et al. (2013). “Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data” (CUPED)

Online Courses: - Stanford CS234: Reinforcement Learning - MIT 6.S897: Machine Learning for Healthcare

Subscribe

Enjoy this blog? Get notified of new posts by email: