This paper originally concentrates on application of firefly algorithm on modeling of flexible beam. An attempt of obtaining a linear parametric model is accomplished by acquiring the input-output data from the vibration of beam and followed by the selection the auto regressive with exogenous inputs (ARX) model structure as a benchmark for mathematical model of beam. The parameters of the model structure are identified using firefly algorithm. A few sets of parameter settings are tested to find the most optimal value. The best parameter setting estimation is selected based on performance of model. The model is compared with the model from conventional estimation approach and validated using validity test. It is found that firefly algorithm produces the best ARX model with the lowest MSE compared to the least square algorithm.