Quinolone and sulfonamide are two classes of antibacterial agents with an opulent history of medicinal chemistry features that contribute to their bacterial spectrum, efficacy, pharmacokinetics, and adverse effect profiles. The urgent need for their use, combined with the escalating rate of their resistance, necessitates the development of suitable analytical methods that accelerate and facilitate their analysis. In this study, the advanced firefly algorithm (FFA) coupled with support vector regression (SVR) was used to select the most significant descriptors and to construct two quantitative structure-retention relationship (QSRR) models using a series of 11 selected quinolone and 13 sulfonamide drugs, respectively, to predict their retention behavior in HPLC. Precisely, the effect of the pH value and acetonitrile composition in the mobile phase on the retention behavior of quinolones and sulfonamides, respectively, were studied. The obtained QSRR models performed well in both internal and external validations, demonstrating their robustness and predictive ability. Y-randomization validation demonstrated that the obtained models did not result by statistical chance. Moreover, the obtained results shed the light on the molecular features that influence the retention behavior of these two classes under the current chromatographic conditions.