Our sensing platform is based upon 2D periodic arrays of palladium nanoparticles that support collective surface lattice resonances (SLRs). These resonances emerge via the hybridization of the LSPRs of the individual nanoparticles and the constructive in-plane diffraction orders of the incoming light, known as Rayleigh anomalies (RAs). Since RAs emerge from interference effects outside the metal nanoparticles, they are characterized by narrow spectral features that are therefore inherited by the SLRs. We employ inverse nanophotonic design-an algorithmic technique to find optical structures with set functional targets, to find sensor array configurations with the highest figure-of-merit (FoM), defined as the ratio between the SLR wavelength shift, Δλ peak , and its FWHM. Critically, we find that the maximum FoM emerging from our evolutionary algorithm is not achieved by the array with the narrowest resonance, but rather by the array with an optimal balance between a narrow SLR and sufficiently large field enhancements inside the nanoparticles. This generic approach, which can benefit any direct plasmonic sensing platform, guides us to identify and experimentally demonstrate a sensor nanoarchitecture with a discernible signal down to 250 ppb; the lowest detection limit reported for an optical hydrogen sensor.