I joined Tencent's Weixin Group (WXG) as a new graduate in 2019 and have worked on the WeChat experimentation platform ever since. My work spans statistical inference, adaptive experimentation, large-scale metric computation, OLAP engines and distributed systems, building efficient, trustworthy infrastructure for experiment data processing and data-driven decision-making across WeChat products, including Search, Official Accounts, Mini Programs, Channels, live streaming and e-commerce.
OLAP engine optimization: ClickHouse NumericIndexedVector
2023 — 2025
BackgroundAt WeChat's billion-user scale, an A/B experiment query has to filter, join and aggregate exposure, profile and behavior records for hundreds of millions of users. Storing the raw records gives low storage density and heavy I/O overhead, and queries are slow and often time out.
GoalStore experiment data far more compactly and answer queries over any time range within seconds.
ActionDesigned and implemented NumericIndexedVector, a new data structure in the ClickHouse engine built on RoaringBitmap and Bit-Sliced Index. Each metric value is represented in binary, and for every bit position a RoaringBitmap stores the IDs of the users whose value has that bit set. Built more than 40 vector operators that work directly on the compressed data, covering arithmetic, conditional filtering and bucketed aggregation, using full-adder and full-subtractor logic and SIMD instructions. This replaces row-by-row JOINs with vector operations in the compressed domain, with no decompression of the underlying records.
ResultStorage shrank to one-third of its previous size. Queries run 3 to 10+ times faster while using one-fifth of the memory. Part of the work has been merged upstream into ClickHouse (#74193).
Related posts
Large-scale real-time metric computation system
2020 — 2025
BackgroundThe WeChat experimentation platform ingests about a trillion rows a day and stores petabytes of data. The original design wrote raw records straight into ClickHouse, retained only 3 days of raw data and often timed out on complex queries. Real-time results were also inconsistent with the daily batch results, and frequent peeking at real-time metrics inflated the Type I error rate.
GoalBuild a low-cost real-time metric system in which streaming and batch processing share a single data source, real-time results agree with daily results, multi-dimensional queries return within seconds, and statistical decisions stay reliable under continuous monitoring.
ActionLed the redesign around real-time ingestion into a data lake, operator-level micro-batch pre-aggregation and vectorized roll-up. Decomposed metric SQL with Calcite so that common operators run once and their results are reused. Pre-aggregated each micro-batch into NumericIndexedVector in ClickHouse and automatically rolled the aggregates up into hourly and daily data, which sharply reduced storage and sped up queries. Designed a stream-delay prediction and backfill mechanism based on historical patterns to keep streaming and batch data aligned. Integrated sequential testing into the real-time query path to control false positives under continuous monitoring, together with CUPED variance reduction to detect effects sooner.
ResultStorage cost dropped to one-fifth of its previous level, and operator reuse cut compute usage by 20%. P99 query latency is under 5 seconds. The system powers real-time monitoring, interactive queries and sound decisions for experiments.
Adaptive experimentation: Bayesian optimization + multi-armed bandits
2020 — 2026
Bayesian optimization experimentsScenarios such as multi-model fusion in recommendation systems involve many hyperparameters. Each online evaluation takes a long time, the search space grows exponentially with the number of parameters, and online performance drifts over time, so manual tuning is slow and classical black-box optimization does not work out of the box. To automate the search, this project built an online parameter-tuning service based on Bayesian optimization (BO) that handles non-stationary, multi-objective, multi-constraint, noisy and high-dimensional problems, and explored joint optimization that combines offline data with online experiments (multi-task BO). This makes joint online tuning of many parameters practical where manual tuning is infeasible, and the service is used in Channels, Search and other products.
Multi-armed bandit experimentsWhen an experiment has many candidate policies, a fixed traffic split leaves each arm with too little traffic, so finding the best one is slow, and it does not optimize cumulative reward during the experiment, which some teams need. Naively reallocating traffic on the fly, however, can introduce Simpson's paradox and, together with non-independent samples and carryover effects, invalidate standard hypothesis tests. To balance reward during the experiment, efficient identification of the best policy and statistical rigor, this project developed two types of multi-armed bandit (MAB) experiments, one maximizing cumulative reward and the other maximizing statistical power, and designed a multi-objective Pareto elimination algorithm, a proportional traffic reallocation scheme and an anytime-valid sequential test. These methods have been deployed in Channels, Search and other products, where they have made policy selection faster and increased the reward earned during experiments.
Selected papers:
Statistical inference and trustworthy evaluation of online experiments
2019 — 2025
BackgroundLarge-scale online experiments at WeChat raise several challenges for statistical inference. At this scale of users and metrics, computing variances and cross-metric covariances is extremely expensive. Small effects are hard to detect quickly. Teams check results frequently (peeking), which severely inflates the Type I error rate of fixed-sample tests. Moreover, the same users are observed repeatedly across days, which violates the independence assumption of conventional tests.
GoalBuild a statistical inference framework that is statistically valid, powerful and computationally efficient, giving product teams a reliable and intuitive basis for decisions.
ActionConducted research and built production implementations of frequentist hypothesis testing and Bayesian inference. Contributed to bucket-based variance and covariance estimation using the delta method, so that statistics are computed over buckets rather than individual users. Shipped fixed-sample hypothesis tests with CUPED variance reduction based on pre-experiment covariates, substantially lowering metric variance and improving sensitivity. Built a Bayesian inference model on conjugate priors and multi-threaded Monte Carlo sampling that reports each variant's probability of being best, expected loss and potential value remaining. Developed and shipped a supermartingale-based sequential test for frequent monitoring and non-independent repeated observations.
ResultCompared with fixed-sample tests, the sequential test cuts the required sample size, and with it the experiment duration, by more than 50% while strictly controlling the Type I error rate. The system supports online experiment evaluation across WeChat's products, and the work led to more than ten invention patent applications.
Selected paper:
Related post