Mixup and Manifold Mixup
Instead of only training a model on real examples, mixup also trains it on honest blends of two examples and their labels — teaching the model to behave sensibly in the space between the data points it has actually seen.
Prerequisites: Data Augmentation for Financial Time Series, Dropout Regularization
A network trained only on the exact examples in a dataset learns to be confident on those points and can behave unpredictably anywhere in between — a feature vector halfway between two training days might get a wildly different prediction than either neighbor, even though nothing about the market changes that abruptly. Standard training never tells the model what "in between" should look like, because it only ever sees whole, unmixed examples. Mixup fixes this by literally training on blends.
The analogy: teaching with blended photographs
Imagine training a model to guess age from a photo, using only real photos labeled with real ages. Now show it a 50/50 double-exposure blend of a 20-year-old and a 60-year-old, and tell it the "correct" answer is 40 — the average of the two ages, weighted by how much of each photo went into the blend. The model has never seen this exact image, but the proportional answer is obvious. Do this with many random pairs and ratios, and the model learns to interpolate smoothly between what it knows, instead of memorizing discrete points and guessing wildly in the gaps.
The mechanics: mixing inputs and labels together
Given two examples and , mixup draws a random blend weight (typically from a Beta distribution concentrated near 0 or 1, so most mixes are mild) and creates a new synthetic example:
In words: the new input is a weighted average of the two raw feature vectors, and — crucially — the new label is the same weighted average of the two original labels. Because is redrawn randomly every pair, every epoch, the model sees an effectively infinite family of blends rather than the finite set of original examples, softening its decision surface and making it less likely to be wildly overconfident on inputs that fall slightly outside anything seen in training.
Manifold mixup applies the same idea at a hidden layer instead of the raw input: run both examples forward to some middle layer, blend their hidden activations there with the same , and continue the forward pass — with the label blended the same way. Hidden representations are usually smoother than raw inputs, so mixing there produces even better-behaved interpolations.
Worked example 1: mixing two labeled feature vectors
Suppose two training rows have features (a 5-day return, a volume ratio) with label (price rose next day) and with label (price fell). Draw . The mixed input is:
and the mixed label is . The network is trained to output (a 70% chance of a rise) given the input — a sensible target, since that input sits mostly, but not entirely, on the "rose" side of the blend.
Worked example 2: why this discourages overconfidence
Without mixup, a network fits every training point toward a hard target of exactly 0 or 1, pushing it toward extremely confident, sharp-edged predictions everywhere, including on noise. With mixup, the same network must also match soft targets like at points between two classes — so its output surface has to curve smoothly rather than snap abruptly. A smoother output surface is less able to memorize individual training points at full confidence, which is exactly what a regularizer is supposed to buy you.
That smooth curve above is the shape mixup pushes a model's output toward — a gradual transition rather than a sharp step at the class boundary.
Mixup trains a model on convex blends of two random examples and the same-proportioned blend of their labels, forcing the model to interpolate smoothly between the points it has actually seen rather than memorizing them as isolated cases.
What this means in practice
Mixup is cheap — it costs almost nothing extra per batch — and reliably improves out-of-sample calibration and robustness to small feature perturbations, valuable since a live feature vector will never exactly match a historical one. It is most natural for continuous, additive features (returns, ratios, spreads) and less natural where a blend has no sensible meaning, such as a one-hot sector code (a 70/30 blend of "Financials" and "Energy" is not a real sector).
Practice
- For , and , with , compute the mixed input and label.
- Explain why mixing a one-hot categorical feature (e.g., sector dummy variables) is problematic, and what you might do instead.
- Manifold mixup blends at a hidden layer instead of the input. Why might that produce a "better-behaved" blend than mixing raw, possibly non-linear input features?
The common confusion is thinking mixup is just another form of noise injection, like jittering. It is not: jittering perturbs one example around itself, while mixup creates a genuinely new example that lies between two different, independently labeled points and gives it the correspondingly blended label. Mixing the inputs but forgetting to mix the labels to the same proportion — leaving them as one-hot originals — destroys the technique entirely and just trains the model on inputs paired with wrong answers.
Related concepts
Practice in interviews
Further reading
- Zhang, Cisse, Dauphin & Lopez-Paz, mixup: Beyond Empirical Risk Minimization (2018)
- Verma et al., Manifold Mixup: Better Representations by Interpolating Hidden States (2019)