An attempt is made to generate the spherical Gaussian distributed basis sets whose parameters are determined by means of a compromise between fully empirical prescriptions and fully optimized procedure. A hypersurface of the energy in a space of nonlinear Gaussian parameters for the molecular ion H 2 ϩ and the H 2 , LiH, and He 2 molecules is carefully analyzed, which allows us to propose a practical scheme for generation of nearly optimal basis sets. Three fundamental elements important for the construction of distributed molecular basis sets are discussed: orbital exponents, positions of basis set functions, and their partition of the localized subsets. Parameters generating nearly optimal exponents and positions of the basis functions are introduced. The set of the employed generating parameters is smaller than the original set of the exponents and positions by about three times. The designed basis sets defined by only 12 nonlinear parameters provide sub-hartree accuracy of three low-lying states of H 2 ϩ . Similarly, sub-hartree accuracy is achieved for the Hartree-Fock energy of H 2 , LiH, and He 2 in the ground electronic state. Simple rules of the parameter reduction found for these molecules can be used for other molecules. Wiley Periodicals, Inc. Int J Quantum Chem 102: 353-367, 2005 Key words: basis set; Gaussian function; HF theory; optimization; variational method Synopsis S imple rules generating nearly optimal spherical Gaussian distributed basis sets for diatomic molecules are derived in this work. These rules are revealed by a careful optimization of nonlinear parameters representing positions and exponents of floating Gaussian functions (FGOs). The optimized basis sets appear to be partitioned into a small number of FGO clusters localized in narrow regions in a molecule. The most distinct clusters are centered in the regions close to molecule nuclei, and they can be described by only few nonlinear parameters generating a nearly optimal sequence of the FGO positions and exponents.The other clusters, simulating the polarization effect, are localized between the nuclei. The exponents of these polarized FGOs form a sequence that can be treated roughly as a small subset taken from the lower part of the nuclear-centered clusters. The polarized FGOs can be localized at the same point placed between the nuclei. The basis sets determined for different types of molecules exhibit similar regular patterns. The rules found for generating parameters reduce greatly the number of the nonlinear FGO parameters and yield the Hartree-Fock (HF) energy with sub-hartree accuracy.