Papers
Topics
Authors
Recent
Search
2000 character limit reached

PyMAL: Multi-Attribution Learning for CVR

Updated 5 July 2026
  • PyMAL is an open-source Python library for multi-attribution learning, leveraging multiple attribution labels to enhance conversion rate prediction.
  • It implements diverse model families—from single-attribution baselines to MAL-specific models like NATAL and MoAE—to facilitate robust evaluation on the MAC dataset.
  • Empirical findings show that integrating auxiliary objectives with asymmetric transfer improves GAUC performance, demonstrating the benefits of multi-attribution optimization.

PyMAL is an open-source Python library, built on PyTorch, for multi-attribution learning (MAL) in conversion rate (CVR) prediction. It is paired with the Multi-Attribution Benchmark (MAC), described as the first public CVR dataset featuring labels from multiple attribution mechanisms, and is intended to make MAL research reproducible, comparable, and extensible by standardizing data loading, training, and evaluation on MAC (Wu et al., 2 Mar 2026). In this setting, MAL denotes joint learning from conversion labels generated under multiple attribution mechanisms rather than a single attribution view, with the explicit goal of improving a business-chosen primary target such as last-click, first-click, linear, or data-driven attribution (DDA).

1. Definition, purpose, and problem setting

PyMAL addresses a specific limitation in CVR modeling: public CVR datasets typically provide conversion labels generated by a single attribution mechanism, whereas production systems often optimize under multiple attribution mechanisms, including last-click, first-click, linear, and DDA (Wu et al., 2 Mar 2026). A single-attribution training regime is therefore treated as a partial view of touchpoint credit, and MAL is introduced as a paradigm that jointly exploits multiple attribution labels to improve the primary task.

Within this framing, PyMAL serves as the algorithmic library used to benchmark MAL methods on MAC. Its stated role is a unified codebase for MAL methods and evaluation on MAC, including classic multi-task models, MAL-specific modeling through NATAL, and the proposed MoAE. It also encodes standard splits, losses, metrics, and auxiliary objective selection strategies observed to matter on MAC.

The library is positioned around four concrete problems: limited public CVR data with only single-attribution labels; lack of reproducible MAL implementations; uncertainty around effective auxiliary targets; and architectural questions concerning how to both fully learn multi-attribution knowledge and fully leverage it for the main task. This organization suggests that PyMAL is not merely a model collection, but a benchmark-oriented experimental substrate for studying attribution-sensitive transfer in CVR prediction.

2. Learning formulation and optimization

PyMAL adopts a multi-attribution setting in which M={A1,A2,,AK}M=\{A_1,A_2,\ldots,A_K\} denotes KK attribution mechanisms, with MAC providing last-click, first-click, linear, and DDA labels (Wu et al., 2 Mar 2026). For each click instance xx, MAC stores continuous attribution weights {wA1,,wAK}\{w^{A_1},\ldots,w^{A_K}\} computed over a fixed attribution window. One mechanism AtA_t is designated as the primary target, while the remaining mechanisms define auxiliary tasks.

The primary prediction problem is written as y^At=fθ(x)\hat{y}^{A_t}=f_\theta(x), with auxiliary tasks used to transfer cross-view knowledge. PyMAL follows the MAC practice of defining positives as samples with positive attribution weights and negatives as samples with zero weight; the weights also serve as sample importance. The per-task supervised loss is binary cross-entropy:

LBCE=1Ni=1N[yilogpi+(1yi)log(1pi)],\mathcal{L}_\text{BCE} = -\frac{1}{N}\sum_{i=1}^{N}\left[y_i \log p_i + (1-y_i)\log(1-p_i)\right],

where yi{0,1}y_i\in\{0,1\} and pi(0,1)p_i\in(0,1).

For joint optimization, PyMAL uses primary-plus-auxiliary aggregation:

L=Lprimary+λk=1K1Laux(k),\mathcal{L}=\mathcal{L}_\text{primary}+\lambda\sum_{k=1}^{K-1}\mathcal{L}_{\text{aux}^{(k)}},

with KK0 tuned. The library also includes optional automatic weighting through GCS and gradient conflict handling through PCGrad. In operational terms, the formulation is a supervised multi-objective CVR setup in which attribution mechanisms are treated as related but non-identical supervision channels.

3. Implemented model families and architectural logic

PyMAL organizes its implemented methods into three families plus MoAE (Wu et al., 2 Mar 2026).

Family Methods Core role
Single-attribution baseline BASE Train only on the primary target’s labels
MTL baselines adapted to MAL Shared-Bottom, MMoE, PLE, HoME Shared representation or expert-based multi-task transfer
MAL-specific models NATAL, MoAE Main-task-aware multi-attribution knowledge transfer

The single-attribution baseline, BASE, uses sequence modeling via target attention (DIN-style), multimodal fusion via SimTier, and an MLP predictor. It provides the no-auxiliary reference point: only the primary target’s labels are used.

The multi-task learning baselines extend standard MTL architectures to MAL. Shared-Bottom uses a shared encoder with separate MLP towers per attribution mechanism. MMoE uses multiple shared experts with task-specific gating:

KK1

PLE progressively separates shared experts and task-specific experts through stacked expert layers and task-specific gates. HoME is an MoE variant with Self-Gate and Feature-Gate, using Swish activations to modulate expert selection by feature granularity.

NATAL is presented as a MAL-specific model that prioritizes the primary task while aggregating knowledge from auxiliary mechanisms through asymmetric transfer and Cartesian-based Auxiliary Training (CAT). Its components are Attribution Knowledge Aggregation (AKA), Primary Target Predictor (PTP), and CAT. With KK2 mechanisms, CAT encodes all binary attribution combinations into a joint class:

KK3

CAT is trained with softmax cross-entropy, and the learned representation is fed into AKA.

MoAE, or Mixture of Asymmetric Experts, is the paper’s proposed method and is implemented in PyMAL. It is motivated by two design principles: fully learn multi-attribution knowledge, and fully leverage this knowledge to serve the main task. Its architecture consists of a bottom MoE backbone, described as PLE-inspired, with one shared expert for public conversion patterns and multiple attribution-specific experts for unique mechanism-specific patterns, followed by an asymmetric transfer module that performs one-way auxiliary-to-main transfer. In generic form,

KK4

KK5

where KK6 are learned transforms and KK7 are learned or input-dependent scalars or gates. Reverse transfer from main to auxiliary is suppressed to preserve main-task priority. Prediction is produced through task-specific MLPs:

KK8

The architectural progression encoded in PyMAL distinguishes symmetric multi-task sharing from explicitly main-task-centric transfer. A plausible implication is that the library is structured not only to compare models, but also to isolate which inductive biases are beneficial under multi-attribution supervision.

4. MAC integration: dataset schema, labels, and evaluation protocol

PyMAL is tightly coupled to MAC, whose scope is 21 consecutive days of Taobao advertising logs, with the last day used as test and previous days used for training; the data are anonymized or hashed, and stratified sampling emphasizes highly active users (Wu et al., 2 Mar 2026). MAC stores continuous attribution weights per click under four attribution mechanisms: last-click, first-click, linear, and DDA. “Direct conversion attribution” is defined as attribution only to clicks for the same item.

The click-level feature schema includes 7 categorical user features, 10 item features, and 3 context features. It also includes a behavior sequence of up to 20 past purchases, where each item contains IDs and a visual-similarity feature from a contrastively pre-trained image encoder. At scale, MAC contains 79M clicks and approximately 0.8M users. Positive ratios vary by mechanism: last-click 1.6%, first-click 1.8%, DDA 4.3%, and linear 5.3%.

PyMAL standardizes evaluation with AUC and GAUC. The AUC definition used is

KK9

and GAUC is user-grouped AUC weighted by click counts:

xx0

The standardized training protocol uses Adam, batch size 4096, one epoch over MAC, and validation on day xx1 using the model from day xx2. Learning rate search covers xx3 scaled by xx4, and loss weighting uses xx5. Auxiliary objective selection is performed through greedy forward selection per target mechanism.

5. Experimental findings and encoded design principles

The MAC experiments incorporated into PyMAL yield three central findings (Wu et al., 2 Mar 2026). First, MAL consistently improves accuracy across attribution targets, with gains especially pronounced for users with long conversion paths. Second, performance generally scales with auxiliary objective complexity, but first-click is an exception: simply adding auxiliary objectives can be counterproductive. Third, two architectural principles are described as paramount: fully learn multi-attribution knowledge, and fully leverage that knowledge for the main task.

These findings are operationalized in the reported performance numbers. MoAE surpasses NATAL in GAUC by +0.23pt for last-click, +0.13pt for first-click, +0.27pt for DDA, and +0.39pt for linear. Relative to BASE, MoAE achieves GAUC lift up to +2.12pt on last-click. The reported gains are most pronounced for users with long conversion paths under linear, last-click, and DDA, which is described as consistent with richer multi-touch information.

PyMAL also encodes concrete guidance on auxiliary objective selection. For last-click targets, including first-click, linear, DDA, and CAT yields the strongest gains. For DDA and linear targets, stacking all other mechanisms plus CAT is helpful. For first-click, only last-click as auxiliary is described as consistently helpful, while adding linear or DDA can hurt, likely due to first-click label noise and temporal confounders. The practical recommendation is therefore greedy forward selection based on validation GAUC rather than indiscriminate auxiliary stacking.

This section corrects a common oversimplification: more auxiliary tasks are not uniformly better. PyMAL’s experiments further note that GCS and PCGrad help weak MTL baselines modestly, but tend to be neutral or negative on strong MAL models such as NATAL and MoAE.

6. Usage, extensibility, limitations, and research outlook

PyMAL is publicly available at https://github.com/alimama-tech/PyMAL, and the MAC dataset is public on HuggingFace at https://huggingface.co/datasets/alimamaTech/MAC (Wu et al., 2 Mar 2026). The practical environment requires Python and PyTorch, with GPUs recommended for large-scale MAC training. The documented workflow is to clone the repository, create a virtual environment, and install dependencies such as pip install -r requirements.txt.

The training and evaluation pipeline is unified. A run specifies the target attribution mechanism, the model among BASE, Shared-Bottom, MMoE, PLE, HoME, NATAL, and MoAE, the auxiliary mechanisms and xx6, and the optimizer, batch size, and learning-rate grid. The repository documents CLI- or config-driven patterns for reproducing MAC splits. PyMAL is also explicitly extensible: adding a new model requires implementing its encoder, gating or transfer logic, and task heads, then registering it in the trainer; adding new auxiliary objectives requires defining their losses and wiring them to the multi-objective aggregation. The modular expert, gate, and transfer components are presented as the main basis for architecture prototyping.

Its limitations are primarily inherited from MAC. Coverage is restricted to four attribution mechanisms and one platform; DDA is instantiated via CausalMTA; conversion attribution is direct and same-item only; real-time operational metrics are excluded; and identifiers are hashed. First-click labels are described as noisier and more confounded, so PyMAL can standardize experiments around that issue but cannot remove the underlying label limitation.

The stated future directions include broader attribution mechanisms, richer multi-modal or foundation-model reasoning, including chain-of-thought, more comprehensive conversion objectives, and advanced ATL methods. Within that trajectory, PyMAL’s modular design is intended to support reproducible research as MAL methods evolve.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to PyMAL.