Reading Propensity Scores Off an ELECTRA Model

When a causal question is posed about text, the "treatment" is often a word choice inside the text itself. A review says a school "has bullying" or does not. A clinical note says a symptom was "ruled out" rather than "confirmed." An abstract hedges with "may" instead of asserting with "will." To estimate the effect of such a choice on an outcome like a rating or an acceptance decision, one needs the propensity score: the probability that the writer made that choice, given everything else in the document. Current practice fits a supervised classifier for this probability on top of a fine-tuned BERT. These classifiers are known to fail in a specific way. Trained to predict the treatment label as accurately as possible, they push probabilities toward 0 and 1, and the reweighting estimators that depend on them blow up. This is one instance of the prediction-estimation trade-off: the model that best predicts the nuisance quantity is not the model that best estimates the causal effect.

This note proposes a different source for the propensity score. Replaced token detection (RTD), the pretraining objective behind ELECTRA, pairs a small masked-language "generator," which proposes plausible substitute words, with a "discriminator" that learns, for every token, whether it is original or a substitute. A slot-level propensity score, meaning the probability that a given word fills a given position in this context, is a conditional word probability. The generator gives a cheap estimate of it, and the discriminator's odds give a learned correction toward the true text distribution. Neither model ever sees the treatment label, so neither can overfit it. Our claim is that this generator-times-discriminator-odds estimate produces propensities with better overlap and lower causal error than supervised propensity heads, even when its classification log-loss is worse. If the claim holds, it would be a concrete, text-native case of trading predictive accuracy for estimation quality.

Core Claim

Consider a treatment defined as which token $w$ fills a slot $s$ in document $x$, with $x_{\setminus s}$ the document with that slot masked. The Bayes-optimal RTD discriminator at a slot separates tokens drawn from the data distribution from tokens drawn from the generator $p_G$. Writing $m$ for the masking rate and $D(w)$ for the discriminator's probability that $w$ is original, the optimum satisfies $D/(1-D) = \frac{(1-m)\,p_{\text{data}}}{m\,p_G}$. Rearranging gives

$$ \hat\pi(w \mid x_{\setminus s}) \;\propto\; p_G(w \mid x_{\setminus s}) \cdot \frac{D(w)}{1 - D(w)}, $$

normalized over the treatment vocabulary (for example, {"not", ∅} or {"may", "will"}). The masking-rate constant cancels in the normalization. The one complication is ELECTRA's convention of labeling a correctly sampled token "original." It shifts the ratio by a term that depends on $p_G(w)$, which we compute exactly. This ratio form is our own derivation from the discriminator's training setup, not a result stated in the ELECTRA paper. It is the step that turns a pretrained RTD pair into a propensity model.

The prediction-estimation hypothesis follows from this. The estimate is shaped by how well the generator spreads probability over plausible alternatives, not by how well a classifier separates treatment labels. It should therefore sit at a different point on the trade-off: worse treatment log-loss, fewer extreme scores, and lower error in the average treatment effect (ATE) once plugged into a doubly robust estimator.

Relation to Prior Work

The motivating evidence comes from text causal inference. Using Text Embeddings for Causal Inference introduced Causal BERT, which fine-tunes BERT with treatment and outcome heads plus a masked-language-modeling term, and argued that predictive sufficiency for treatment and outcome implies causal sufficiency. Using Text-Based Causal Inference to Disentangle Factors Influencing Online Review Ratings applied Causal BERT to 677,210 school reviews. It found that accurate treatment prediction produced extreme propensities, and it needed temperature scaling plus down-weighting of the treatment loss to stabilize augmented inverse probability weighting (AIPW). We keep their estimators. What we replace is the source of the propensity: supervised and label-fit in their work, label-free and read from pretraining objectives in ours.

The trade-off itself is documented in several places. Adapting Neural Networks for the Estimation of Treatment Effects showed that Dragonnet with targeted regularization gets better causal estimates despite worse outcome prediction error. Optimal Nuisance Function Tuning for Estimating a Doubly Robust Functional under Proportional Asymptotics proved that prediction-optimal ridge penalties are variance-suboptimal for a doubly robust functional, but only for linear Gaussian models. Causal Regularization argues that cross-validation favors confounded shortcuts. These papers constrain our design. They predict that selecting propensity models by held-out log-loss will mislead, so we report the full log-loss-versus-ATE-error curve rather than a single tuned point.

Adjustment for Confounding using Pre-Trained Representations shows that frozen BERT embeddings break Lasso and forest nuisance learners, while neural nuisance learners inside Double Machine Learning (DML) adapt to the embeddings' low intrinsic dimension. This is our strongest frozen-feature competitor. We reuse its DML-with-neural-network setup through DoubleML.

On the RTD side, ELECTRA supplies the generator-discriminator pair and two warnings. BERT predicts masked words better than ELECTRA's generator does, and generators that are too strong or too weak hurt the discriminator. Prompting ELECTRA shows that discriminator scores over candidate tokens are usable zero-shot and separate opposites such as "great" and "terrible" better than RoBERTa. That is the property our ratio correction relies on. To Learn or Not to Learn shows RTD can be steered toward negation through continued pretraining. This motivates negation as one of our treatment families.

The obvious idea at this intersection is to swap BERT for ELECTRA inside Causal BERT. We treat that only as a baseline. Our contribution is a propensity estimator that does not use a supervised treatment head at all.

Research Program

The work has three parts. The first is the estimator. We will implement slot-level propensities from pretrained ELECTRA generator-discriminator pairs, with the label-convention correction and normalization over a treatment vocabulary. We will also implement an optional domain-adaptive continued-RTD-pretraining step on the unlabeled study corpus, which never uses treatment labels. For document-level presence treatments, such as "mentions bullying anywhere," we approximate the propensity with a noisy-or over candidate sentence slots. We flag this approximation explicitly as the weakest part of the method.

The second part is integration. The RTD propensity is paired with an outcome model, a fine-tuned ELECTRA or BERT regressor with cross-fitting, inside AIPW and the DML interactive regression model. A hybrid variant uses the RTD propensity as a prior that a supervised head may adjust. The mixing weight is chosen by a causal criterion, either the semi-synthetic ATE error on a held-out simulation or the estimated AIPW variance, rather than by log-loss.

The third part is the trade-off analysis. For every propensity source we sweep its sharpness knob: temperature for supervised heads, the treatment-loss weight $\alpha$ for Causal BERT, and generator size (1/8 to 1× the discriminator) for RTD. For each setting we plot treatment log-loss against ATE error and against the effective sample size of the inverse weights. Sweeping generator size lets us ask whether ELECTRA's middle-sized generator, the best one for pretraining, is also the best one for estimation.

Baselines

The naive reference is the unadjusted difference in mean outcome between treated and untreated documents. On GreatSchools it gave −0.26 for bullying, against −0.16 from calibrated Causal BERT (Using Text-Based Causal Inference…). Any method must remove most of that gap on our semi-synthetic versions, where the true effect is known.

The strongest supervised competitor is calibrated Causal BERT: BERT fine-tuned with treatment and outcome heads and a masked-language-modeling term, with temperature-scaled propensities and a tuned $\alpha$, as in that paper. It is the strongest because it already targets propensity degeneracy directly. We run it with the same outcome model, the same cross-fitting folds, and the same hyperparameter budget as our method, giving every method an equal number of trials, with temperature and $\alpha$ tuned on-folds as recommended by Hyperparameter Tuning for Causal Inference with Double Machine Learning. The file contains no reported numerical ATE error for this method on any text benchmark, and no reported result was found on Lacuna for Causal BERT error on PeerRead or Reddit, so we will reproduce it ourselves. Beating it means lower ATE mean absolute error and better coverage of nominal 95% intervals, averaged over simulation seeds and confounding strengths, at matched compute.

The strongest frozen-feature competitor is DML with neural-network nuisance learners on frozen BERT and frozen ELECTRA embeddings, following Adjustment for Confounding using Pre-Trained Representations. That paper reports near-unbiased IMDb ATE estimates but gives no numerical bias values in the file, so we reproduce it as well. The backbone-swap baseline is Causal BERT with an ELECTRA discriminator in place of BERT. It isolates whether any gain comes from RTD representations or from the label-free propensity.

Three ablations isolate the key ingredient. The first uses the generator probability $p_G$ alone, without the discriminator correction. The second uses the masked-word probability from a full-size BERT, which predicts masked words better than ELECTRA's generator. The third uses the RTD propensity without domain-adaptive pretraining. For reference on how much a nuisance-aware design can matter, targeted regularization cut ACIC 2018 mean absolute error from 1.45 (TARNET) to 0.35 (Adapting Neural Networks…). That is tabular data and not directly comparable, but it indicates the size of effect the trade-off can carry.

Why not just…?

Why not just swap ELECTRA into Causal BERT? The supervised treatment head is what causes propensity degeneracy, and swapping the backbone keeps that head. If anything, ELECTRA's sharper separation of opposites (Prompting ELECTRA) may make treatment prediction even more confident. The backbone-swap baseline tests this directly. If it matches our estimator, the contribution reduces to "use ELECTRA," and we will report it that way.

Why not just temperature-scale the supervised propensity? Temperature scaling rescales confidence uniformly. It cannot fix a model that has learned treatment-correlated shortcuts that are not confounders, which is the failure Causal Regularization describes. Our sweep covers the whole temperature range, so if some temperature dominates the RTD estimate on the log-loss-versus-ATE-error curve, this alternative wins and the experiment will show it.

Why not just read the masked-word probability from a big BERT? This is the most serious threat. ELECTRA itself reports that BERT predicts masked words better than its generator does, and a raw masked-language-model probability is already label-free. Our bet is that the discriminator's correction captures in-domain lexical regularities the generator misses, and that it matters most for subtle choices like negation and hedging. The full-size-BERT ablation settles the question. If it matches the corrected RTD estimate, the honest conclusion is that label-free propensities help and the RTD correction does not, and we will state that.

Why not just use frozen embeddings with neural DML? That approach has theory behind it (Adjustment for Confounding…), but its propensity network is still fit to the treatment label and inherits the same pressure toward extreme scores. We compare effective sample sizes of the inverse weights alongside ATE error to see whether the extra overlap translates into lower variance.

Proposed Experiments

We build semi-synthetic benchmarks on real text, following the PeerRead and Reddit designs of Using Text Embeddings for Causal Inference, the IMDb setup of Adjustment for Confounding…, and the GreatSchools corpus. Treatments are real slot-level lexical choices: negation at a predicate, hedge versus assertion in abstracts, and topic keywords in reviews. Outcomes are simulated from a known function of the treatment and of confounding features of the surrounding text, at three confounding strengths and with many random seeds. The confounding features are a topic variable and a sentiment variable derived from held-out annotations, so that no method sees the truth.

The metrics are ATE mean absolute error, 95% interval coverage, the fraction of propensities outside [0.01, 0.99], and treatment log-loss. Results are reported both as curves over each method's sharpness knob and at each method's causally tuned point.

Two checks are decisive. The first: at matched compute and budget, the corrected RTD propensity in AIPW or DML beats calibrated Causal BERT and both full-size-BERT ablations on ATE error while having worse treatment log-loss. That outcome would be the prediction-estimation trade-off showing up in text. The second: the generator-size sweep finds a causal optimum, and we check whether it coincides with ELECTRA's pretraining optimum of 1/4 to 1/2 discriminator size. If the corrected estimator fails to beat the full-size-BERT masked-probability ablation, we drop the RTD-specific claim. Failure on presence-type treatments alone would confine the method to slot-level choices, and we would report that scope limit directly. Real-data GreatSchools estimates are reported last, as a consistency check against the published −0.16, not as evidence of accuracy.