Existing quantitative trait locus (QTL) mapping had low efficiency in identifying small-effect and closely linked QTL-by-environment interactions (QEIs) in RILs, especially in the era of global climate change. To address this challenge, here we integrate the compressed variance component mixed model with our GCIM to propose 3vGCIM for identifying QEIs in RILs, and extend 3vGCIM-random to 3vGCIM-fixed. 3vGCIM integrates genome-wide scanning with machine learning, significantly improving power. In the mixed full model, we consider all possible effects and control for all possible polygenic backgrounds. In simulation studies, 3vGCIM exhibits higher power (∼92.00%), higher accuracy of the estimates for QTL position (∼1.900 cM2) and effect (∼0.050), and lower false positive rate (∼0.48‰) and false negative rate (<8.10%) in three environments of 300 RILs each than ICIM (47.57%; 3.607 cM2, 0.583; 2.81‰; 52.43%) and MCIM (60.30%; 5.279 cM2, 0.274; 2.17‰; 39.70%). In the real data analysis of yield-related in 240 RILs, 3vGCIM mines more known genes (57∼60) and known gene-by-environment interactions (GEIs) (14∼19) and candidate GEIs (21∼23) than ICIM (27, 2, and 7), and MCIM (21, 1, and 3), especially in small-effect and linked QTLs and QEIs. This makes 3vGCIM a powerful and sensitive tool for QTL mapping and molecular QTL mapping.