Learning Large-scale Neural Fields via Context Pruned Meta-Learning

Jihoon Tack, Subin Kim, Sihyun Yu, Jaeho Lee, Jinwoo Shin, Jonathan Richard Schwarz

TL;DR

Fitting Neural Fields (NFs) to high-resolution data is notoriously slow and memory-intensive. This paper introduces GradNCP, a meta-learning framework that drastically cuts memory usage by dynamically pruning the training data (e.g., pixels or voxels) at each step. This enables the meta-learning of NFs on massive signals like 1024x1024 images and 3D videos that previously crashed GPUs.

The Challenge of Scaling Neural Fields

Neural Fields (also known as Implicit Neural Representations) are a powerful way to represent continuous signals. Instead of storing an image as a grid of pixels, a neural network is trained to map coordinates to values (e.g., $x, y \rightarrow r, g, b$). This allows for infinite resolution scaling, easy compression, and a unified format for images, audio, and 3D scenes.

However, training a fresh neural network for every single signal (like every frame of a video) takes an eternity. Researchers typically use meta-learning (like MAML) to find a highly optimized "initialization" weight, allowing new signals to be fitted in just a few gradient steps.

The catch is that meta-learning scales terribly with dataset size. In NF terms, the "dataset" (or context set) for a single 1024x1024 image is over a million coordinate points. Meta-learning requires storing the computational graph and intermediate activations for all these points across multiple steps to calculate second-order gradients. This causes massive GPU memory bottlenecks, forcing researchers to either abandon meta-learning for high-res data or severely limit the number of training steps, which leads to poor performance and "myopia" (where the model forgets how to learn if run for more steps than it was trained for).

GradNCP: Gradient Norm-based Context Pruning

To solve this memory bottleneck, the authors introduce GradNCP. Instead of using the entire signal for every inner optimization step, GradNCP intelligently selects a small subset of the most "important" points.

Key innovations include:

  • Cheap Online Pruning: To figure out which points are most important without wasting compute, GradNCP scores points based on the squared gradient norm of the last layer of the network. This is an incredibly cheap $O(M)$ operation that accurately approximates how much the overall loss would drop if that point were used.
  • Bootstrap Correction: Pruning data naturally introduces some bias and information loss. To fix this, the authors generate a "target" model by taking a few extra optimization steps using the full context set (using a stop-gradient to save memory). They then add a meta-loss that forces the pruned model to match this high-quality target.
  • Test-time Gradient Scaling: At test time, memory isn't an issue, so the full signal can be used. However, because the model was trained on a pruned set of "high-error" points, the gradient sizes differ. GradNCP applies a simple scaling factor to test-time gradients to match the statistics seen during training, ensuring smooth optimization.

Datasets and Modalities

The authors demonstrate GradNCP's versatility across multiple modalities:

  • Images: CelebA, Imagenette, Text (standard benchmarks), plus high-resolution datasets like ImageNet (256x256), CelebA-HQ (up to 1024x1024), and AFHQ (512x512).
  • Video: UCF-101 (up to 256x256x32 resolution) and Kinetics-400 (used for cross-domain adaptation).
  • Audio: LibriSpeech.
  • Manifolds/Climate: ERA5 (global temperature data mapped to spherical coordinates).
  • 3D Scenes: ShapeNet Cars (for NeRF view synthesis).

Key Insights and Ideas

GradNCP Context Selection
  • Pruning acts as an automated curriculum: By always selecting the points with the highest gradient norms, GradNCP naturally focuses on learning the global structure of an image first. Once the basics are down, the high-error points shift to the edges and textures, allowing the model to dedicate later steps entirely to high-frequency details.
  • Meta-learning makes cheap approximations better: You might wonder if using only the last layer's gradient is a good proxy for the whole network. Surprisingly, the authors found that as meta-learning progresses, the correlation between the last-layer gradient and the full-network gradient actually increases. The meta-learning dynamics actively push the network into a state where this cheap approximation is highly accurate.
  • Bootstrapping cures myopia: The bootstrap correction doesn't just fix pruning bias; it solves the notorious short-horizon bias (myopia) of meta-learning. By forcing the model to match a target that looked further ahead, the initialization learns to maintain plasticity, allowing it to be fine-tuned for many steps at test time without plateauing.

Key Results

  • Shattered Memory Ceilings: GradNCP successfully meta-learned on 1024x1024 images and 256x256x32 videos. Previous state-of-the-art methods (like TransINR and standard Learnit/MAML) simply ran out of memory (OOM) on a 40GB NVIDIA A100 GPU at these resolutions.
  • Massive Quality Jumps: GradNCP consistently outperformed baselines. For example, it improved Peak Signal-to-Noise Ratio (PSNR) from 38.28 to 40.60 on CelebA, and achieved a massive jump from 28.86 to 35.28 on UCF-101 videos.
  • Speed: GradNCP reaches the peak performance of existing meta-learning methods in just 55% of the wall-clock time (a 1.8x speedup).

Limitations and Future Work

While GradNCP is highly memory efficient during the backward pass, its scoring mechanism still requires a single forward pass over the entire context set to evaluate which points to prune. The authors acknowledge that for extremely high-resolution signals (e.g., a long 8K video), even a single forward pass might exceed memory limits.

For future work, they suggest exploring iterative tree-search methods—starting with a low-resolution grid and incrementally increasing the resolution only in areas with high gradient norms, bypassing the need to ever evaluate the full signal at once.

Summary updated

BibTeX
@inproceedings{tack2023learning,
  author = {Jihoon Tack and Subin Kim and Sihyun Yu and Jaeho Lee and Jinwoo Shin and Jonathan Richard Schwarz},
  title = {{Learning Large-scale Neural Fields via Context Pruned Meta-Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=QGmNMtK3pQ},
}
Figure