Papers
Topics
Authors
Recent
Search
2000 character limit reached

Recurrent FiLM Generators for Sequence Modeling

Updated 12 March 2026
  • Recurrent FiLM generators are architectural modules that dynamically modulate CNN activations using RNN-produced scaling and shifting parameters, efficiently capturing long-range dependencies in sequential data such as text, audio, or genomic sequences.
  • They integrate a convolutional backbone with a recurrent network to generate adaptive FiLM parameters, offering improved performance over static modulations and deep pure-CNNs, while maintaining computational efficiency.
  • Empirical evaluations demonstrate that recurrent FiLM generators enhance accuracy in text classification, boost audio super-resolution quality, and reduce perplexity in language modeling with modest computational overhead.

Recurrent FiLM generators are architectural components designed to dynamically modulate convolutional neural network (CNN) activations through feature-wise linear modulation (FiLM) parameters produced by a recurrent neural network (RNN). This construction, exemplified by the Temporal FiLM (TFiLM) module, enables efficient capture of long-range dependencies in sequential data such as text, audio, or genomic sequences by allowing information from prior time steps to influence the current convolutional activations via learned, adaptive scaling and shifting coefficients (Birnbaum et al., 2019).

1. High-Level Data Flow and Architectural Overview

A recurrent FiLM generator processes a sequence of inputs {x1,,xT}\{x_1,\dots,x_T\}. A convolutional backbone (typically 1D convolutions with dilation or pooling) ingests a windowed subset of recent inputs at each time step tt, producing a feature map htRC×Lh_t \in \mathbb{R}^{C \times L}, where CC is the number of feature channels and LL is the spatial or temporal extent. In parallel, an RNN (e.g., gated recurrent unit (GRU) or long short-term memory (LSTM)) maintains a hidden state stRHs_t \in \mathbb{R}^{H} that evolves over time.

At each time step, the RNN consumes a summary statistic of the convolutional output (such as global average pooling over hth_t) or a direct embedding of xtx_t (or both) as input ztz_t, updating its hidden state:

st=GRU(st1,zt)s_t = \mathrm{GRU}(s_{t-1}, z_t)

The RNN then predicts per-channel FiLM scale and shift parameters tt0 via a linear projection:

tt1

These coefficients modulate the convolutional map as:

tt2

This modulated map tt3 is forwarded to subsequent convolutional layers, classifiers, or decoders. The RNN’s temporal dynamics allow arbitrarily long-range dependencies to be encoded into the feature-wise modulations of the CNN, outperforming pure feed-forward convolutions (with bounded receptive fields) and offering substantial computational advantages compared to deep recurrent stacks.

2. Mathematical Formulation

At time tt4, the system can be formalized as:

  • Feature extraction via convolution:

tt5

  • RNN update (with tt6 a function of tt7 or tt8):

tt9

where htRC×Lh_t \in \mathbb{R}^{C \times L}0, then projected to htRC×Lh_t \in \mathbb{R}^{C \times L}1.

  • FiLM parameter generation:

htRC×Lh_t \in \mathbb{R}^{C \times L}2

  • Feature-wise modulation:

htRC×Lh_t \in \mathbb{R}^{C \times L}3

Optionally, the modulated feature map is further processed (e.g., by passing through additional convolutions or non-linearity) or used for prediction.

3. Implementation Considerations

Key architectural decisions and optimizations include:

  • RNN Choices: Single-layer GRU with htRC×Lh_t \in \mathbb{R}^{C \times L}4 hidden units is typical; LSTM with htRC×Lh_t \in \mathbb{R}^{C \times L}5–htRC×Lh_t \in \mathbb{R}^{C \times L}6 also viable. Input htRC×Lh_t \in \mathbb{R}^{C \times L}7 may concatenate global-pooled htRC×Lh_t \in \mathbb{R}^{C \times L}8 (dimension htRC×Lh_t \in \mathbb{R}^{C \times L}9) and embeddings of CC0, projected via affine layers.
  • Integration Points: Commonly, a TFiLM layer follows every convolutional block; for lightweight variants, only the terminal block is modulated.
  • Computational Cost: The combined cost of recurrent and linear projections scales as CC1, yielding modest overhead for CC2, CC3, and sequence length CC4 in the thousands. The unbounded effective receptive field, provided by recurrence, contrasts sharply with the depth-limited field of pure CNNs.
  • Stability and Optimization: Training employs Adam (learning rate CC5) or SGD with momentum. RNN gradients are clipped (CC6), and stabilization is enhanced via weight normalization on CC7 and layer normalization inside the RNN. Dropout (CC8–CC9) is applied to RNN inputs and feature maps.

4. Empirical Evaluation

Performance of recurrent FiLM generators was assessed on classification, regression, and sequence modeling tasks:

  • Text classification (Yelp, AG News, DBpedia): A 4-block dilated CNN baseline achieves LL088% accuracy. Static FiLM (parameters predicted once from the first token) yields LL189%, whereas TFiLM with a GRU-generator attains LL290.5%, matching/exceeding much deeper pure-CNN or pure-RNN networks. Freezing the FiLM parameters reduces accuracy by LL31.2% absolute.
  • Audio super-resolution (×4 upsampling at 16kHz): A pure CNN achieves 19 dB SNR; static FiLM improves this to 19.3 dB. TFiLM further raises SNR to 21 dB and exhibits improved high-frequency synthesis.
  • Language modeling (Penn Treebank): TFiLM-enhanced CNNs outperform comparable 1D-CNNs by LL40.5 perplexity, closely matching a 2-layer LSTM but with reduced parameter count. More than 2 RNN layers yields negligible gains.

For all tasks, TFiLM induces a computational slowdown of LL51.1× relative to the base CNN, but remains LL6–LL7 times faster than deep RNNs processing the full sequence.

5. Advantages, Limitations, and Extensions

Advantages:

  • Conveys long-range temporal dependencies without necessitating very deep CNNs or unrolling extensive RNNs.
  • Channel-selective modulation by the RNN is parameter-efficient.
  • Modular and compatible with a range of convolutional architectures for audio, text, or vision.

Limitations:

  • Introduces the need to unroll an RNN over LL8 steps, albeit with a small hidden state.
  • Modulation is coarse (per-channel shift and scale), potentially less effective for tasks requiring precise intra-window timing.

Potential Extensions:

  • Substitution of the RNN with a self-attention mechanism (yielding an “attention-based FiLM generator”) for longer-range interactions.
  • Stacking recurrent FiLM generators at various depths, enabling “deep temporal modulation.”
  • Multi-modal fusion by learning LL9 jointly from diverse sources (e.g., language and vision).
  • Integration with conditional normalization layers for further gains.

6. Pseudocode and Workflow Summary

A compact pseudocode representation (PyTorch-like) is as follows:

stRHs_t \in \mathbb{R}^{H}0

All components—recurrent state evolution, per-channel linear modulation, and efficient convolutional feature extraction—together define the Temporal FiLM paradigm and its role as a recurrent FiLM generator for sequence modeling (Birnbaum et al., 2019).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Recurrent FiLM Generators.