Temporal Convolutional Networks
A temporal convolutional network scans a time series with sliding filters instead of stepping through it one point at a time, letting it see far into the past through stacked layers while processing the whole sequence in parallel.
Prerequisites: The Multilayer Perceptron, Recurrent Neural Networks
A recurrent network reads a time series one step at a time, carrying forward a running summary — which means step 500 cannot start until step 499 has finished, and it must compress everything relevant from the past into a single fixed-size memory. That's slow to train (no parallelism across time) and fragile over long histories (old information keeps getting overwritten). An alternative borrows the tool built for scanning images for local patterns — the convolution — and points it at a time axis instead of a pixel grid.
Picture a small window sliding along a strip of daily returns, at every position multiplying the values under it by a fixed set of weights and summing them up — the same operation a moving average performs, except the weights are learned rather than chosen to be equal. Stack several such windows on top of each other, each one scanning the output of the layer below, and the network builds up an ability to recognize longer and longer patterns, the way stacking small local filters in an image network builds up recognition of larger shapes from edges to textures to objects.
The mechanics, one symbol at a time
For a 1-D convolution with filter weights (a window of size ) applied to a sequence , the output at position is:
In words: to compute the output at time , take the most recent inputs ending at , multiply each by its own learned weight, and add them up — a weighted local summary, like a moving average with weights the model gets to choose rather than each. Crucially the sum only reaches backward to for , never forward to — this is called a causal convolution, and it exists specifically so the model at time never gets to see the future when predicting it.
A single layer with window size only sees steps back. To see further without a huge window, TCNs use dilation: layer skips over inputs with a stride of , so layer 1 looks at consecutive steps, layer 2 looks at every other step, layer 3 every fourth step, and so on. Stacking dilated layers gives a receptive field — the span of raw input a single output can "see" — that grows exponentially with depth, roughly , instead of only linearly with a plain stack.
Worked example 1: one causal convolution by hand
A filter with weights (most recent input weighted heaviest) applied to daily returns , where is today.
This output uses only today and the two days before it — nothing from tomorrow — and combines them with weights the network learned rather than a fixed average. Slide the same filter one step and recompute using the next three values; it's applied identically at every position, which is what makes it a convolution rather than a one-off weighted sum.
Worked example 2: receptive field growth with dilation
Three stacked layers, filter size , dilation doubling each layer: layer 1 dilation 1, layer 2 dilation 2, layer 3 dilation 4.
Layer 1's receptive field: it looks back step, so it spans 2 raw time points.
Layer 2 looks back steps in layer 1's output, and each of those layer-1 outputs already spans 2 raw points, so layer 2's total reach is raw time points.
Layer 3 looks back steps in layer 2's output; adding that to what layer 2 already covers gives a receptive field of raw time points.
Just three layers, filter size 2, and the network already sees 8 days back — a plain (non-dilated) 3-layer stack with the same filter size would see only 4. Add a few more dilated layers and the receptive field reaches hundreds of days, all while every layer's computation for every time step can run in parallel, unlike an RNN.
The explorer above lets you see how a power-law curve accelerates; receptive field versus depth under dilation grows the same way — each additional layer roughly doubles the reach instead of adding a fixed amount.
What this means in practice
TCNs are used for return forecasting, volatility modeling, and order-book sequence tasks where long lookback windows matter and training speed matters — because every time step's convolution can run in parallel on a GPU, TCNs train substantially faster than an RNN over the same data. They're paired with residual connections almost by default (deep dilated stacks otherwise suffer the same gradient problems as any deep network) and with weight normalization for stability. The causal masking is non-negotiable in finance specifically: a convolution that peeks even one step forward is a leak of future information into a supposedly historical forecast, and that leak will make backtests look far better than live trading ever will.
A temporal convolutional network scans a sequence with learned, causal filters and stacks dilated layers so the receptive field — how far back a prediction can see — grows exponentially with depth, all while processing the sequence in parallel rather than one step at a time.
The classic confusion: using an off-the-shelf convolution layer without checking that it's masked to be causal. A standard 1-D convolution, borrowed straight from image or audio code, centers its window on each output position and therefore looks forward as well as backward — in a time series that means the model is trained using tomorrow's return to predict today's, producing a backtest that is quietly cheating and will collapse the moment it faces genuinely unseen data.
Practice in interviews
Further reading
- Bai, Kolter & Koltun, An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling
- Goodfellow, Bengio & Courville, Deep Learning, ch. 9