ReFrame: Layer Caching for Accelerated Inference in Real-Time Rendering

Lufei Liu, Tor M. Aamodt

Introduction and The Rendering Bottleneck

Graphics rendering applications increasingly leverage neural networks in tasks such as denoising, supersampling, and frame extrapolation to improve image quality while maintaining high frame rates (60–120 FPS). In modern gaming and VR, developers often render a low-resolution, noisy "draft" and rely on these networks to produce the final high-fidelity image.

However, these neural networks have become a significant computational bottleneck themselves, consuming a large portion of the strict frame time budget. The authors of ReFrame observed a massive redundancy in this process: because consecutive frames in a video game are highly correlated (a property known as temporal coherence), the "deep" features calculated by a network for one frame are often nearly identical to those needed for the next.

Visualizing temporal coherence across consecutive frames and the corresponding FLIP score.

ReFrame aims to eliminate this redundant computation by caching and reusing intermediate layer features across consecutive frames. By exploiting the fact that high-level image features change slowly, it accelerates inference without making the final image look "stale" or blurry.

The ReFrame Methodology

ReFrame specifically targets encoder-decoder architectures (like U-Nets and U-Net++), which are the workhorses of modern image processing.

1. Layer Caching

In a standard U-Net, the encoder compresses the image into high-level features, and the decoder expands them back into a full-resolution image. ReFrame caches the output of the deepest layers. For subsequent frames, the network skips the expensive middle layers and simply "plugs in" the cached features into the decoder. It then combines these cached deep features with fresh data from the shallowest layers (via skip connections) to preserve sharp, high-frequency details.

2. Adaptive Caching Policies

The primary challenge with caching is knowing when to refresh the cache. If the camera moves too fast or a sudden animation occurs, the old features become "stale." The authors propose several policies to manage this:

  • Every-N: Refresh the cache every $N$ frames. While simple, this is prone to visual quality "spikes" if a sudden change occurs between refreshes.
  • Frame Deltas (Adaptive): This core innovation calculates the difference (SMAPE) between the current input and the cached input. If the change exceeds a specific threshold ($\tau$), it triggers a full refresh.
  • Motion Vector Threshold: This policy uses the rendering engine's existing motion data to decide if the scene has changed too much to safely reuse the cache.

Key Insights and Experimental Setup

The authors evaluated ReFrame across three distinct rendering tasks using high-fidelity scenes: Frame Extrapolation (FE) using the ExtraNet model, Neural Supersampling (SS) using a Fourier-based network (FBSR), and Image Composition (IC) using the Implicit Depth model.

Several key insights emerged from their experiments:

  • Semantic Stability: High-level features (the "what" of a scene) are more temporally stable than low-level pixels (the "where" of the light). This allows for aggressive caching in the middle of the network while still updating the edges and textures.
  • Training-Free Acceleration: Unlike many optimization techniques, ReFrame is "plug-and-play." It does not require retraining the original model, making it highly practical for existing rendering pipelines.
  • The Quality-Performance Swap: The authors suggest a clever trade-off: developers can use the time saved by ReFrame to render a higher-quality initial input (e.g., more ray-tracing samples). This can actually result in a better final image than the baseline, even with caching enabled.
  • Orthogonality: ReFrame works alongside other optimizations. Combining ReFrame with sparse computation frameworks like DeltaCNN can compound latency reductions.

Results and Limitations

Performance and Quality

Experimental results show that ReFrame achieves an average 1.4$\times$ speedup on an NVIDIA RTX 2080 Ti, with some frame extrapolation tasks reaching up to 1.72$\times$. It successfully reduced the number of FLOPs (Floating Point Operations) in the encoder-decoder sections by approximately 40% using a low-sensitivity adaptive policy.

Crucially, using the FLIP metric (which mimics human visual perception), the authors demonstrated that the errors introduced by caching are almost entirely unnoticeable to the human eye, scoring well below the thresholds of "acceptable loss" established in other state-of-the-art research.

Limitations and Future Work

Despite its success, ReFrame has a few limitations:

  • Architectural Constraints: It is currently designed for convolutional encoder-decoder networks and does not yet support Transformer-based architectures.
  • Frame Rate Jitter: Because a "refresh" frame takes longer to compute than a "cached" frame, ReFrame can introduce variability in frame times. While it improves average latency, it does not perfectly solve the "worst-case" latency needed for perfectly smooth V-Sync.

Future work will explore more sophisticated, dynamic sensitivity settings that can adjust the refresh threshold on the fly based on the complexity of the current scene.

Summary updated

BibTeX
@inproceedings{liu2025reframe,
  author = {Lufei Liu and Tor M. Aamodt},
  title = {{ReFrame: Layer Caching for Accelerated Inference in Real-Time Rendering}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=HZCx5EToh9},
}
Figure