Silicon-based optical phased arrays (OPAs) have been widely explored, while the design of the structure with high sidelobe level reduction, remains a big challenge. This work investigated the optimization of the optical path-modulated 3D OPAs with
S
i
3
N
4
as the core layer and
S
i
O
2
as the cladding layer. We used the particle swarm optimization algorithm to optimize high-performance random distributed OPAs. Our study provides an effective pathway to optimize the random distributed OPAs within a controllable time frame among a vast number of parameters.