In the era of massive datasets, the primary constraint on machine learning algorithms is often not the number of processor cycles available, but the physical limits of memory. Many classical algorithms—from Support Vector Machines (SVMs) to K-Medoids clustering—rely on pre-computing and storing large structures like pairwise distance matrices or high-dimensional feature mappings. When a dataset grows to millions of samples, these structures scale quadratically, quickly exceeding the capacity of even the most robust hardware.
A growing body of research suggests a counter-intuitive solution: stop storing data and start recomputing it. By calculating distances, features, and combinatorial indices "on-the-fly," researchers are trading redundant computation for a significantly reduced memory footprint, often achieving better performance on modern hardware.
The Memory-Compute Trade-off
The traditional approach to large-scale optimization involves a "compute once, store forever" philosophy. However, as Ren et al. demonstrate in their work on Global Optimal K-Medoids Clustering, storing a full pairwise distance matrix for one million samples is memory-prohibitive. By re-calculating these distances during each optimization iteration, the authors reduced memory complexity from quadratic to linear, enabling provably optimal clustering at a scale 400x larger than previous exact solvers.
This strategy is not limited to clustering. In the realm of kernel machines, Sonnenburg et al. proposed COFFIN, a framework that computes feature mappings dynamically during optimization. This approach bypasses the "curse of support vectors" by replacing memory-intensive I/O operations with on-demand computation, allowing linear SVMs to handle datasets that would otherwise exceed available RAM.
Why Recomputation is Faster than Retrieval
While recomputing values might seem inefficient, the architecture of modern processors has shifted the balance. Today, the cost of fetching data from high-latency global memory often exceeds the cost of performing a calculation on a CPU or GPU.
Gieseke et al. highlight this in their work on Speedy greedy feature selection, noting that many-core architectures can re-calculate distances faster than they can fetch them from memory. By re-calculating distances dynamically during nearest neighbor searches, they avoid memory bandwidth bottlenecks, leveraging high computational throughput to offset latency.
This "IO-aware" philosophy is taken further by Ye et al. in FlashSinkhorn. By recomputing interaction costs within fast on-chip memory rather than retrieving them from global memory, the authors achieved up to 161× speedups for Optimal Transport problems. This approach allows solvers to scale linearly with memory, making large-scale distribution matching practical on modern GPUs.
Algorithmic Indexing and Combinatorial Generation
Beyond distances and features, memory bottlenecks often arise from storing complex indices or sets of combinations. In high-dimensional causal discovery, the number of variable combinations to test grows exponentially.
To address this, Zarebavani et al. developed cuPC, which calculates variable combination indices dynamically using mathematical functions rather than pre-computed tables. Similarly, Jiang et al. show in Fast Parallel Bayesian Network Structure Learning that generating conditioning sets algorithmically using lexicographical functions avoids the massive memory overhead of pre-calculation. These techniques allow researchers to analyze dense, high-dimensional networks that were previously intractable.
Broad Applications of On-Demand Computation
The shift toward on-the-fly computation is appearing across diverse domains:
- Bioinformatics: The authors of Memory-Efficient A* Heuristics for Multiple Sequence Alignment use an octree-based approach to compute complex heuristics on demand, reducing the memory footprint of A* search.
- Graph Theory: Tepper et al. integrate Boruvka’s algorithm with spatial search structures to compute distances dynamically, enabling Minimum Spanning Tree calculations for hundreds of thousands of points with negligible memory.
- Kernel Methods: Sindhwani et al. recompute random feature blocks from raw data during each optimization iteration, enabling the training of kernel machines on terabyte-scale implicit matrices.
By treating memory as the scarcest resource and computation as a cheap, renewable commodity, these methods provide a scalable path forward for high-dimensional data analysis. As Duran-Mateluna et al. suggest, the future of large-scale optimization lies in developing algorithms that can "forget" and recompute, rather than those that attempt to remember everything.
Key Foundational Work
COFFIN: A Computational Framework for Linear SVMs (2010) — contributed 2 concept elements to this direction.
Memory-Efficient A* Heuristics for Multiple Sequence Alignment (2002) — contributed 1 concept elements to this direction.