Abstract
Background: In recent years, using deep learning models to generate music has become the mainstream direction in AI music. However, the main models for music generation still face several issues, the biggest of which is the inability to effectively simulate musical structure, hindering computers from creating compositions that conform to musical structures. Objective: To address this, we need to explore which models can effectively simulate the structure of music and create more humanized music. Methods: We conduct comparative experiments, analyzing the advantages and disadvantages of music generated by LSTM and Transformer models, and propose improvements based on the findings. Results: Experimental results demonstrate that LSTM performs better than Transformer in simulating musical structure in shorter sequences, but struggles with longer sequences; whereas Transformer outperforms LSTM in handling longer sequences and can effectively simulate musical structure in longer sequences after improvements, creating compositions that align with human musical perception. Conclusion: Therefore, we believe that the Transformer model is more suitable for AI music composition tasks, and improving its attention mechanism to enhance recognition of musical structure will be the mainstream direction for music generation in the future.
References
Devlin, J., Chang, M.-W., Lee, K., et al. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) (pp. 4171–4186).
Dai, Z., Yang, Z., Yang, Y., et al. (2019). Transformer-XL: Attentive language models beyond a fixed-length context. In Proceedings of Annual Meeting of the Association for Computational Linguistics (ACL) (pp. 2978–2988).
Huang, C.-Z. A., Vaswani, A., Uszkoreit, J., Simon, I., et al. (2018). Music transformer: Generating music with long-term structure. In Proceedings of International Conference on Learning Representations (ICLR).
Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780.
Katharopoulos, A., Vyas, A., Pappas, N., et al. (2020). Transformers are RNNs: Fast autoregressive transformers with linear attention. In Proceedings of International Conference on Machine Learning (ICML) (pp. 5156–5165).
Yu, B., Lu, P., Wang, R., et al. (2022). Museformer: Transformer with Fine- and Coarse-Grained Attention for Music Generation. In Proceedings of the 35th Conference on Neural Information Processing Systems (NeurIPS).
Rae, J. W., Potapenko, A., Jayakumar, S. M., et al. (2020). Compressive transformers for long-range sequence modelling. In Proceedings of International Conference on Learning Representations (ICLR).
Rizvi, D. R., Nissar, I., Masood, S., et al. (2020). An LSTM based deep learning model for voice-based detection of Parkinson's disease. International Journal of Advanced Science and Technology, 29(8).
Roy, M., Saffar, A., Vaswani, A., et al. (2021). Efficient content-based sparse attention with routing transformers. Transactions of the Association for Computational Linguistics (TACL), 9, 53–68.
Shaw, P., Uszkoreit, J., & Vaswani, A. (2018). Self-attention with relative position representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers) (pp. 464–468).
Vaswani, A., Shazeer, N., Parmar, et al. (2017). Attention is All You Need. In Advances in Neural Information Processing Systems.
Wu, F., Wu, T., Qi, B., Jiao, D., Jiang, D., et al. (2021). Smart bird: Learnable sparse attention for efficient and effective transformer. arXiv preprint arXiv:2108.09193.
Hsiao, W.-Y., Liu, J.-Y., Yeh, Y.-C., et al. (2021). Compound word transformer: Learning to compose fullsong music over dynamic directed hypergraphs. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), 35, 178–186.
Zhu, H., Chen, E., Liu, Q., Yuan, N., et al. (2018). Band: A melody and arrangement generation framework for pop music. In The 24th ACM SIGKDD International Conference (pp. 2837–2846).
Zeng, M., Tan, X., Wang, R., et al. (2021). MusicBERT: Symbolic music understanding with large-scale pre-training. In Proceedings of Findings of the Association for Computational Linguistics (ACL Findings) (pp. 791–800).
Hizlisoy, S., Yildirim, S., & Tufekci, Z. (2021). Music emotion recognition using convolutional long-shortterm memory deep neural networks. Engineering Science and Technology, an International Journal, 24(3), 760–767.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Copyright (c) 2023 The Author(s). Published by Journal of Global Arts Studies.
