WaveNet and Dilated Causal Convolutions
WaveNet stacks causal convolutions whose dilation doubles at every layer, so the range of past context a prediction can see grows exponentially with depth instead of linearly, using very few layers.
Prerequisites: Causal Padding and Look-Ahead Leakage, Receptive Fields and Dilation
A plain causal convolution stack can see further into the past only by adding more layers, one extra layer typically buys only a few extra timesteps of context. Covering weeks of tick data this way would need an impractically deep stack. Is there a way to cover a huge stretch of history using only a handful of layers?
The analogy: radar rings that skip further each time
Picture a series of radar sweeps down a street, each one spaced further apart than the last, the first sweep checks every step, the next checks every second step, the next every fourth step, and so on. After only a few sweeps, you've covered a huge distance using barely more equipment, because each sweep's spacing compounds on the one before it. Dilated convolutions do exactly this to a time series: each layer's kernel samples inputs spaced further apart than the layer before it.
The mechanics
Layer uses dilation : with kernel size , layer 's output at time depends on , always causal, per causal padding, but sampling positions spaced apart. After stacked layers with dilations , the overall receptive field is:
In words: because each layer's dilation doubles the one before it, the total span of past timesteps a prediction can draw on grows exponentially with the number of layers, not linearly, a small increase in depth buys a disproportionately large increase in lookback.
Worked example 1: receptive field with 4 layers
Kernel size , dilations across 4 layers: timesteps of context, using only 4 layers.
Worked example 2: compare to non-dilated layers
Same kernel size , but 4 plain (non-dilated, dilation throughout) causal conv layers: timesteps. Dilation delivered timesteps of context versus for the same 4 layers and same kernel size, roughly more lookback for identical depth, and the gap widens further as more layers are added, since the non-dilated case grows only linearly while the dilated case keeps doubling.
Receptive field size against depth grows exactly like this, watch the curve as the exponent increases:
Doubling the dilation at each successive causal convolution layer makes the receptive field grow exponentially with depth instead of linearly, letting a handful of layers cover a long lookback window cheaply and in parallel, while every output remains strictly a function of the past.
What this means in practice
Dilated causal convolutions are attractive for long financial time series because they capture long lookback windows, weeks of tick data, cheaply, and because all timesteps within a layer compute in parallel, unlike a recurrent network which must process one step at a time; training is correspondingly much faster, while remaining strictly causal for legitimate live forecasting use.
A large nominal receptive field does not mean the model attends to every position inside it equally, or even at all. Dilation means a given layer literally only samples specific past positions, every -th one, so information at the skipped-over positions must be captured by an earlier, less-dilated layer and carried forward through the stack. Too few layers, or a dilation schedule with unintended gaps, can leave some positions inside the nominal receptive field effectively invisible to the final output.
Discussion
💡 Discussion rules
- Ask and answer about this concept. Off-topic gets removed.
- No homework dumps. Show what you tried first.
- Corrections are welcome. Cite a source when you claim an error.
Loading discussion…
Related concepts
Practice in interviews
Further reading
- van den Oord et al., WaveNet: A Generative Model for Raw Audio (2016)