An optical modulator with ultra small plasmonic nano rods that can filter the coherent optical frequency is developed. The performance of optical modulator based on dimmer metal nano rods on the top of silicon waveguides as coherent perfect absorber (CPA) is studied. In the proposed model, the optical modulator is excited by two monochromatic incident plan waves with the same frequencies and two polar angles "$$\uptheta =0$$?=0" and "$$\uptheta =\Pi /2$$?=?/2". When the signal with $$\uptheta =0$$?=0 is applied to the modulator separately, the incident wave transmits from the first path and suppresses for the second one, while when both signals are applied to the modulator simultaneously, the CPA occurs for the first path and the ligthwave transmits from the second one. Therefore for two paths there are two states. "on" state when ligthwave transmitted from each path and "off" state when ligthwave suppressed. In this case two paths consist of different array of nano rods locations. Since the CPA efficiency depends strongly on the number of plasmonic nano rods and the nano rods location, a new efficient binary optimization method based the teaching---learning-based optimization (TLBO) algorithm is proposed to design an optimized array of the plasmonic nano-rods in order to achieve the maximum absorption coefficient in the `off' state and the minimum absorption coefficient in the `on' state. In Binary TLBO, a group of learner consists a matrix with binary entries, control the presence (`1') or the absence (`0') of nano rods in the array.