Skip to content

Mixup

Mixup interpolates pairs of training inputs and their targets with one shared coefficient. Learn the soft-target construction and its limits for financial data.

Mixup is a training-data augmentation method that interpolates two inputs and their targets using the same weight. For a quant classifier, it offers a way to regularise the fit between observed feature vectors; it also makes an assumption about what the model should predict at synthetic inputs.

The input and label travel together

For training observations (xA,yA)(x_A,y_A) and (xB,yB)(x_B,y_B), form

x~=λxA+(1−λ)xB,y~=λyA+(1−λ)yB.\begin{aligned} \widetilde{x}&=\lambda x_A+(1-\lambda)x_B,\\ \widetilde{y}&=\lambda y_A+(1-\lambda)y_B. \end{aligned}
In the original method, λ∼Beta⁡(α,α)\lambda\sim\operatorname{Beta}(\alpha,\alpha) with α>0\alpha>0, and pairs come from the training data. The Beta distribution controls where interpolations fall between endpoints. Mixup encourages intermediate predictions between training examples; it does not force the whole network to be linear. Zhang et al. (2018), §2 give the construction and its regularisation rationale.
Consider a fictional two-feature, two-class example. Features are dimensionless and class order is A, B:
ObservationInput vectorOne-hot target
A(0,2)(0,2)(1,0)(1,0)
B(2,0)(2,0)(0,1)(0,1)
Fix λ=0.25\lambda=0.25 for this calculation; this is a stipulated coefficient, not a reported random draw. Then
x~=0.25(0,2)+0.75(2,0)=(1.5,0.5),y~=0.25(1,0)+0.75(0,1)=(0.25,0.75).\begin{aligned} \widetilde{x}&=0.25(0,2)+0.75(2,0)=(1.5,0.5),\\ \widetilde{y}&=0.25(1,0)+0.75(0,1)=(0.25,0.75). \end{aligned}

The synthetic point lies one quarter of the way from B toward A. Its target consequently gives class B three quarters of the weight. Reversing the weights only in the label would break the construction.

Fictional input A is at (0, 2) with target (1, 0), and B is at (2, 0) with target (0, 1). A weight of 0.25 for A and 0.75 for B gives mixed input (1.5, 0.5) and class target weights 0.25 and 0.75.
Fictional input A is at (0, 2) with target (1, 0), and B is at (2, 0) with target (0, 1). A weight of 0.25 for A and 0.75 for B gives mixed input (1.5, 0.5) and class target weights 0.25 and 0.75.
The input and target use the same pair weights. The point is closer to B, whose class receives the larger target weight.
The soft target is a prescription for training, not evidence that a real observation at this input has a 75% chance of belonging to B. For classification, a soft-target cross-entropy loss can use these weights directly. Equivalently, evaluate the two original class losses at the same mixed input, then weight those losses by 0.25 and 0.75. Averaging losses at the two original inputs instead would leave out the input interpolation.
Mixup also differs from label smoothing: the second target comes from the paired observation, while uniform label smoothing uses a fixed reference distribution and leaves the input unchanged. Mixing two A-class observations leaves their one-hot target unchanged. The original paper compares these alternatives in §3.8.

A straight line in feature space need not be a market scenario

Suppose the coordinates represent standardised volatility and liquidity indicators. Their weighted average can be computed, but the resulting vector need not describe an attainable joint market state. Mixing categorical indicators can create fractional categories; mixing prices and engineered ratios separately can break the identities that connected them. Interpolating two financial paths does not, by itself, construct a self-financing strategy or establish a causal counterfactual.

These are reasons to examine the feature representation and pairing rule, rather than treating extra synthetic rows as extra independent history. The paper's tabular experiments, §3.6, do not establish that mixup improves financial forecasts.
For a time-based experiment, select pairs inside the training fold, using only observations and labels available by that fold's cutoff. Fit scalers and other preprocessing there too. A future or held-out row does not become permissible because it receives a small mixing weight. Keep validation and test observations unmixed when measuring performance on real outcomes; choose augmentation settings on validation and reserve the final test. Overlapping forward-looking labels still require appropriate separation across folds.
The SelfMadeQuant lesson Regularization, Weight Decay, Dropout, Early Stopping, and Validation Discipline develops the broader training-only augmentation and evaluation discipline. Its preview is public; the full lesson requires membership.

Sources

Last updated
  • machine learning
  • data augmentation
  • regularisation
  • soft targets
← Back to the glossaryBack to top ↑