We employed random distributions and gradient descent methods for the Generator Coordinate Method (GCM) to identify effective basis wave functions, taking halo nuclei \(^6\) He and \(^6\) Li as examples. By comparing the ground state ( \(0^+\) ) energy of \(^6\) He and the excited state ( \(0^+\) ) energy of \(^6\) Li calculated with various random distributions and manually selected generation coordinates, we found that the heavy tail characteristic of the logistic distribution better describes the features of the halo nuclei. Subsequently, the Adam algorithm from machine learning was applied to optimize the basis wave functions, indicating that a limited number of basis wave functions can approximate the converged values. These results offer some empirical insights for selecting basis wave functions and contribute to the broader application of machine learning methods in predicting effective basis wave functions.