Scaling Laws for Sparsely-Connected Foundation Models